aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.DS_Storebin6148 -> 0 bytes
-rw-r--r--README21
-rw-r--r--Resources/app.js84
-rw-r--r--Resources/friendship/config/config.js5
-rw-r--r--Resources/friendship/friendship.js10
-rw-r--r--Resources/friendship/ui/ApplicationWindow.js20
-rw-r--r--Resources/friendship/ui/LikeList.js7
-rw-r--r--Resources/friendship/ui/LoginWindow.js21
-rw-r--r--Resources/friendship/ui/ui.js9
9 files changed, 80 insertions, 97 deletions
diff --git a/.DS_Store b/.DS_Store
deleted file mode 100644
index 16d875f..0000000
--- a/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/README b/README
index cb993a6..9aa6488 100644
--- a/README
+++ b/README
@@ -1,18 +1,7 @@
-Welcome to your Appcelerator Titanium Mobile Project
+FriendShip
+==========
-This is a blank project. Start by editing your application's app.js to
-make your first mobile project using Titanium.
-
-
-
-----------------------------------
-Stuff our legal folk make us say:
-
-Appcelerator, Appcelerator Titanium and associated marks and logos are
-trademarks of Appcelerator, Inc.
-
-Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved.
-
-Titanium is licensed under the Apache Public License (Version 2). Please
-see the LICENSE file for the full license.
+# Development Setup
+Titanium 1.6.2 SDK download link: http://builds.appcelerator.com.s3.amazonaws.com/mobile/1_6_X/mobilesdk-1.6.2-20110418144400-osx.zip
+ (from http://builds.appcelerator.com.s3.amazonaws.com/index.html)
diff --git a/Resources/app.js b/Resources/app.js
index d5d4cb3..bf28cac 100644
--- a/Resources/app.js
+++ b/Resources/app.js
@@ -1,82 +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'
-});
-
-// Don't forget to set your appid and requested permissions, else the login button
-// won't be effective.
-Titanium.Facebook.appid = '258369447595838';
-Titanium.Facebook.permissions = ['publish_stream'];
-Titanium.Facebook.addEventListener('login', function(e) {
- if (e.success) {
- alert('Logged in');
- }
-});
-Titanium.Facebook.addEventListener('logout', function(e) {
- alert('Logged out');
-});
-
-// add the button. Note that it doesn't need a click event or anything.
-var fb_button = Titanium.Facebook.createLoginButton({ top: 50, style: 'wide' });
-//Titanium.UI.currentWindow.add();
-
-win1.add(label1);
-win1.add(fb_button);
-
-//
-// 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/config/config.js b/Resources/friendship/config/config.js
new file mode 100644
index 0000000..dc86a0e
--- /dev/null
+++ b/Resources/friendship/config/config.js
@@ -0,0 +1,5 @@
+(function() {
+ // Facebook
+ Titanium.Facebook.appid = '258369447595838';
+ Titanium.Facebook.permissions = ['publish_stream'];
+})();
diff --git a/Resources/friendship/friendship.js b/Resources/friendship/friendship.js
new file mode 100644
index 0000000..8d3f437
--- /dev/null
+++ b/Resources/friendship/friendship.js
@@ -0,0 +1,10 @@
+var fs = {};
+
+(function() {
+ fs.app = {};
+})();
+
+Ti.include(
+ '/friendship/config/config.js',
+ '/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/LoginWindow.js b/Resources/friendship/ui/LoginWindow.js
new file mode 100644
index 0000000..cbb803b
--- /dev/null
+++ b/Resources/friendship/ui/LoginWindow.js
@@ -0,0 +1,21 @@
+(function() {
+ function createFBLoginButton () {
+ // Don't forget to set your appid and requested permissions, else the login button
+ // won't be effective.
+
+ Titanium.Facebook.addEventListener('login', function(e) {
+ if (e.success) {
+ alert('Logged in');
+ }
+ });
+ Titanium.Facebook.addEventListener('logout', function(e) {
+ alert('Logged out');
+ });
+
+ // add the button. Note that it doesn't need a click event or anything.
+ return Titanium.Facebook.createLoginButton({
+ top: 50,
+ style: 'wide'
+ });
+ };
+})();
diff --git a/Resources/friendship/ui/ui.js b/Resources/friendship/ui/ui.js
new file mode 100644
index 0000000..f548cfd
--- /dev/null
+++ b/Resources/friendship/ui/ui.js
@@ -0,0 +1,9 @@
+(function() {
+ fs.ui = {};
+})();
+
+Ti.include(
+ '/friendship/ui/ApplicationWindow.js',
+ '/friendship/ui/LikeList.js',
+ '/friendship/ui/LoginWindow.js'
+)