Skip to content

Instantly share code, notes, and snippets.

/**
* We're going to create an infinite scrollable list. In this case, we're going to show a date. When you swipe left,
* you'll see yesterday. Then the day before yesterday, and so on. Swiping right shows you tomorrow, and so on.
*/
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
var isAndroid = Ti.Platform.osname === 'android';
/**
* Track where we are in the infinite scrollable views, and define how large of a step goes between each view.
*/
var currentDate = new Date(), msIntervalBetweenViews = 1000/*ms*/ * 60/*s*/ * 60/*m*/ * 24/*h*/;
@mauropm
mauropm / app.js
Created December 17, 2012 22:18 — forked from minhnc/app.js
var win = Ti.UI.createWindow();
win.open();
/// <<< Register & UnRegister Event Listeners
/**
* params: {event: 'event', callback: eventCallback}
*/
function registerEventListener(obj, params) {
if ( typeof obj._eventListeners == 'undefined' ) {
@mauropm
mauropm / app.js
Created July 27, 2012 18:24 — forked from egomez99/app.js
Android background service
/*global Ti, alert */
var SECS = 5;
var URL = 'testservice.js';
var win = Ti.UI.createWindow({
fullscreen: false,
navBarHidden: true,
exitOnClose: true
});
/*
Developed by Kevin L. Hopkins (http://kevin.h-pk-ns.com)
You may borrow, steal, use this in any way you feel necessary but please
leave attribution to me as the source. If you feel especially grateful,
give me a linkback from your blog, a shoutout @Devneck on Twitter, or
my company profile @ http://wearefound.com.
/* Expects parameters of the directory name you wish to save it under, the url of the remote image,
and the Image View Object its being assigned to. */
cachedImageView = function(imageDirectoryName, url, imageViewObject)
@mauropm
mauropm / customTabsIniOS.js
Created December 16, 2011 21:13 — forked from dawsontoth/app.js
Customize the look of the tab bar in iOS Appcelerator Titanium
/**
* Override a tab group's tab bar on iOS.
*
* NOTE: Call this function on a tabGroup AFTER you have added all of your tabs to it! We'll look at the tabs that exist
* to generate the overriding tab bar view. If your tabs change, call this function again and we'll update the display.
*
* @param tabGroup The tab group to override
* @param backgroundOptions The options for the background view; use properties like backgroundColor, or backgroundImage.
* @param selectedOptions The options for a selected tab button.
* @param deselectedOptions The options for a deselected tab button.