Skip to content

Instantly share code, notes, and snippets.

View anfaguerrero's full-sized avatar

Andres Fabian anfaguerrero

View GitHub Profile
@nowelium
nowelium / gist:1106112
Created July 26, 2011 06:25
Android Notification re-launching
var activityClassName = Ti.App.id + '.' + Ti.App.name.substring(0, 1).toUpperCase() + Ti.App.name.substring(1) + 'Activity';
var intent = Titanium.Android.createIntent({
//className: 'org.appcelerator.titanium.TiActivity',
//packageName: Ti.App.id,
className: activityClassName,
action: Titanium.Android.ACTION_MAIN,
flags: 0x10200000
});
intent.addCategory(Titanium.Android.CATEGORY_LAUNCHER);
@rileydutton
rileydutton / collabsablerows.js
Created April 28, 2011 16:03
Collapsable/Expandable Table View Rows in Titanium Mobile
var container = Ti.UI.createView({backgroundColor: "white", layout: "vertical"});
var layout = [
{
title: "Parent 1",
isparent: true,
opened: false,
sub: [
{
@jpurcell
jpurcell / pull-to-refresh(android).js
Created April 5, 2011 15:58
Tweetie-like pull to refresh and pull to load more. Note that it requries set heights for everything.
// This is the Android version of the Tweetie-like pull to refresh table:
// http://developer.appcelerator.com/blog/2010/05/how-to-create-a-tweetie-like-pull-to-refresh-table.html
var win = Ti.UI.currentWindow;
var alertDialog = Titanium.UI.createAlertDialog({
title: 'System Message',
buttonNames: ['OK']
});
var scrollView = Ti.UI.createScrollView({
@marshall
marshall / activity1.js
Created February 22, 2011 17:24
Native Titanium + Android example code
var activity = Ti.Android.currentActivity;
var win = Ti.UI.currentWindow;
activity.addEventListener("create", function(e) {
var button = Ti.UI.createButton({title: "Hello world"});
button.addEventListener("click", function(e) {
activity.finish();
});
win.add(button);
});
@mschmulen
mschmulen / TableViewNeverending.js
Created February 1, 2011 02:07
Titanium tableView with a continuous amount of data.
//
// in this demo, we simply show how you could dynamically scroll
// with a continuous amount of data in the tableview by detecting
// when the user's scroll position gets near the end of the table
// and start a background fetch of new data and seamlessly append
// the new data to the table automatically
//
var win = Ti.UI.createWindow();