This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var scrollingUp = false; | |
var prevIndex = 1; | |
Ti.API.debug('init: scrolling down'); | |
tableView.scrollToIndex(1); | |
tableView.addEventListener('scroll',function(e){ | |
Ti.API.debug('prev '+prevIndex+', curr '+e.firstVisibleItem+', scrollingUp '+scrollingUp); | |
if (prevIndex > e.firstVisibleItem) { | |
if (!scrollingUp) { | |
Ti.API.debug('scrolling up'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var win = Ti.UI.currentWindow; | |
var data = [ | |
{title:"Row 1",color:'#000',height:50}, | |
{title:"Row 2",color:'#000',height:50}, | |
{title:"Row 3",color:'#000',height:50}, | |
{title:"Row 4",color:'#000',height:50}, | |
{title:"Row 5",color:'#000',height:50}, | |
{title:"Row 6",color:'#000',height:50}, | |
{title:"Row 7",color:'#000',height:50}, |