aboutsummaryrefslogtreecommitdiffstats
path: root/Resources/friendship/ui/ApplicationWindow.js
diff options
context:
space:
mode:
authorAnqi Xu2012-06-24 01:38:24 -0400
committerAnqi Xu2012-06-24 01:38:24 -0400
commit020def806678f46fc39a2baad5a48e58c41ec742 (patch)
tree015c49112ecf9b90a540b366a4a65a5504cac449 /Resources/friendship/ui/ApplicationWindow.js
parentb847cd11cebcc0a56ffc2043d4372e3be488e45c (diff)
downloadLikeFeed-020def806678f46fc39a2baad5a48e58c41ec742.tar.bz2
Added auto-refresh
Diffstat (limited to 'Resources/friendship/ui/ApplicationWindow.js')
-rw-r--r--Resources/friendship/ui/ApplicationWindow.js33
1 files changed, 13 insertions, 20 deletions
diff --git a/Resources/friendship/ui/ApplicationWindow.js b/Resources/friendship/ui/ApplicationWindow.js
index babc43c..a88990d 100644
--- a/Resources/friendship/ui/ApplicationWindow.js
+++ b/Resources/friendship/ui/ApplicationWindow.js
@@ -3,30 +3,22 @@
var tab_group = Ti.UI.createTabGroup();
Ti.UI.currentTabGroup = tab_group;
- var login_button = Ti.Facebook.createLoginButton({
- top: 50,
- style: 'wide'
- });
-
- var debug_button = Ti.UI.createButton({title: 'Debug'});
- debug_button.addEventListener('click', function(e) {
- // Show loading view
- var loading = fs.ui.createLoadingView();
- win.add(loading);
- Ti.App.fireEvent('app:show.loader');
-
- Ti.API.info('Logged in: ' + JSON.stringify(Ti.Facebook.loggedIn));
- if (Ti.Facebook.loggedIn) {
- fs.core.queryAllFriendPostsFQL();
- }
- });
+ var login_button = Ti.Facebook.createLoginButton();
+ var refresh_button = Ti.UI.createButton({
+ image: 'images/refresh.png',
+ width: 10.0,
+ height: 10.0,
+ }); // TODO: figure out how to resize buttons
+ refresh_button.addEventListener('click', fs.ui.refreshLikeList);
var win = Ti.UI.createWindow({
- title: 'FriendShip',
+ //title: 'FriendShip',
tabBarHidden: true,
- leftNavButton: debug_button,
- rightNavButton: login_button,
+ leftNavButton: refresh_button,
+ rightNavButton: login_button, // TODO: remove before deployment
});
+ var loading = fs.ui.createLoadingView();
+ win.add(loading);
var tab = Titanium.UI.createTab({
icon:'KS_nav_views.png',
@@ -35,6 +27,7 @@
});
win.add(fs.ui.createLikeList());
+ fs.ui.refreshLikeList();
tab_group.addTab(tab);
return tab_group;