diff options
| -rw-r--r-- | Resources/app.js | 66 | ||||
| -rw-r--r-- | Resources/friendship/friendship.js | 9 | ||||
| -rw-r--r-- | Resources/friendship/ui/ApplicationWindow.js | 20 | ||||
| -rw-r--r-- | Resources/friendship/ui/LikeList.js | 7 | ||||
| -rw-r--r-- | Resources/friendship/ui/ui.js | 8 |
5 files changed, 47 insertions, 63 deletions
diff --git a/Resources/app.js b/Resources/app.js index b10ea40..bf28cac 100644 --- a/Resources/app.js +++ b/Resources/app.js @@ -1,64 +1,4 @@ -// this sets the background color of the master UIView (when there are no windows/tab groups on it) -Titanium.UI.setBackgroundColor('#000'); +Ti.include('/friendship/friendship.js'); -// create tab group -var tabGroup = Titanium.UI.createTabGroup(); - - -// -// create base UI tab and root window -// -var win1 = Titanium.UI.createWindow({ - title:'Tab 1', - backgroundColor:'#fff' -}); -var tab1 = Titanium.UI.createTab({ - icon:'KS_nav_views.png', - title:'Tab 1', - window:win1 -}); - -var label1 = Titanium.UI.createLabel({ - color:'#999', - text:'I am Window 1', - font:{fontSize:20,fontFamily:'Helvetica Neue'}, - textAlign:'center', - width:'auto' -}); - -win1.add(label1); - -// -// create controls tab and root window -// -var win2 = Titanium.UI.createWindow({ - title:'Tab 2', - backgroundColor:'#fff' -}); -var tab2 = Titanium.UI.createTab({ - icon:'KS_nav_ui.png', - title:'Tab 2', - window:win2 -}); - -var label2 = Titanium.UI.createLabel({ - color:'#999', - text:'I am Window 2', - font:{fontSize:20,fontFamily:'Helvetica Neue'}, - textAlign:'center', - width:'auto' -}); - -win2.add(label2); - - - -// -// add tabs -// -tabGroup.addTab(tab1); -tabGroup.addTab(tab2); - - -// open tab group -tabGroup.open(); +fs.app.mainTabGroup = fs.ui.createApplicationTabGroup(); +fs.app.mainTabGroup.open(); diff --git a/Resources/friendship/friendship.js b/Resources/friendship/friendship.js new file mode 100644 index 0000000..fa00b10 --- /dev/null +++ b/Resources/friendship/friendship.js @@ -0,0 +1,9 @@ +var fs = {}; + +(function() { + fs.app = {}; +})(); + +Ti.include( + '/friendship/ui/ui.js' +); diff --git a/Resources/friendship/ui/ApplicationWindow.js b/Resources/friendship/ui/ApplicationWindow.js new file mode 100644 index 0000000..ff9a9c3 --- /dev/null +++ b/Resources/friendship/ui/ApplicationWindow.js @@ -0,0 +1,20 @@ +(function() { + fs.ui.createApplicationTabGroup = function() { + var tab_group = Ti.UI.createTabGroup(); + var win = Ti.UI.createWindow({ + title: 'FriendShip', + tabBarHidden: true + }); + + var tab = Titanium.UI.createTab({ + icon:'KS_nav_views.png', + title:'Likes', + window: win + }); + + win.add(fs.ui.createLikeList()); + tab_group.addTab(tab); + + return tab_group; + }; +})(); diff --git a/Resources/friendship/ui/LikeList.js b/Resources/friendship/ui/LikeList.js new file mode 100644 index 0000000..8552b56 --- /dev/null +++ b/Resources/friendship/ui/LikeList.js @@ -0,0 +1,7 @@ +(function() { + fs.ui.createLikeList = function() { + var ll_view = Ti.UI.createTableView(); + + return ll_view; + }; +})(); diff --git a/Resources/friendship/ui/ui.js b/Resources/friendship/ui/ui.js new file mode 100644 index 0000000..b86383a --- /dev/null +++ b/Resources/friendship/ui/ui.js @@ -0,0 +1,8 @@ +(function() { + fs.ui = {}; +})(); + +Ti.include( + '/friendship/ui/ApplicationWindow.js', + '/friendship/ui/LikeList.js' +) |
