Skip to content

Instantly share code, notes, and snippets.

View artanisdesign's full-sized avatar

Gergely Cziva artanisdesign

View GitHub Profile
@artanisdesign
artanisdesign / loader
Created November 17, 2012 11:28
circleloader
var CircleLoaderView = require("CircleLoaderView");
var myloader = new CircleLoaderView({
width : 200,
centerWidth : 100,
backgroundColor : "#fff",
tintColor : "blue",
textColor : "red",
labelFontSize : 28
@artanisdesign
artanisdesign / gist:4071742
Created November 14, 2012 11:59
save image, and hires image to filesystem
api.cachedImageView = function(imageDirectoryName, url, imageViewObject, hires) {
var filename = url.split('/');
var hiresfilename;
filename = filename[filename.length - 1];
hiresfilename = filename.split('.');
hiresfilename = hiresfilename[hiresfilename.length - 2] + '@2x' + hiresfilename[hiresfilename.length - 1];
var file = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, imageDirectoryName, filename);
var hiresfile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, imageDirectoryName, hiresfilename);
if(file.exists()) {
imageViewObject.image = file.nativePath;
@artanisdesign
artanisdesign / app.js
Created June 25, 2012 19:22 — forked from pec1985/app.js
Pull to Refresh in android, plus a demo
/*
Copyright 2011 Pedro Enrique
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@artanisdesign
artanisdesign / app.js
Created June 25, 2012 19:21 — forked from pec1985/app.js
Cool background color for iPhone
var win = Ti.UI.createWindow({
backgroundColor:'stripped'
});
win.open();
@artanisdesign
artanisdesign / zscroll.html
Created June 5, 2012 07:02 — forked from cers/zscroll.html
Scrolling along the Z-Axis
<html>
<head>
<title>Scrolling along the Z-Axis</title>
<!--
Example from http://eng.wealtfront.com
Assumes browser window is sized at a height of 400px (the size of the black box).
-->
<style>
body{height:600px;}
#viewport {
@artanisdesign
artanisdesign / app.js
Created June 4, 2012 13:04 — forked from iskugor/app.js
How to append a row to particular section in Titanium
(function() {
var win = Ti.UI.createWindow();
var section1 = Ti.UI.createTableViewSection({
headerTitle:'Header 1'
});
for (var i=0; i < 4; i++) {
section1.add(Ti.UI.createTableViewRow({
title:'Row '+i
}));
}
@artanisdesign
artanisdesign / gist:2867609
Created June 4, 2012 10:11 — forked from mattapperson/gist:1621570
titanium android tabbar DOWN
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
@artanisdesign
artanisdesign / PagingControl.js
Created April 19, 2012 05:28 — forked from raulriera/PagingControl.js
Custom paging control for scrollableViews for Titanium Appcelerator
// I was unhappy about there was close to no control over the "pageControl"
// in scrollableViews, so I hacked my own
// -----
var pages = [];
var page;
var numberOfPages = 0;
// Configuration
var pageColor = "#c99ed5";
@artanisdesign
artanisdesign / nofilecache
Created February 24, 2012 18:00
no more file cache in titanium
var a = Titanium.Filesystem.getFile( Titanium.Filesystem.applicationDirectory, "../Library/Caches/ASIHTTPRequestCache/SessionStore/" );
if( a.exists() ) {
a.deleteDirectory(true);
}
@artanisdesign
artanisdesign / InfiniteScrollingTableView.js
Created January 5, 2012 01:11 — forked from dawsontoth/InfiniteScrollingTableView.js
Infinite loading table view for iOS and Android.
/**
* We're going to create an infinite loading table view. Whenever you get close to the bottom, we'll load more rows.
*/
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
var isAndroid = Ti.Platform.osname === 'android';
/**
* Create our UI elements.
*/
var table = Ti.UI.createTableView({ top: 0, right: 0, bottom: 0, left: 0 });