This repository has been archived by the owner on Sep 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kevin Whinnery
authored and
Kevin Whinnery
committed
Mar 2, 2010
1 parent
4d0db58
commit c1b4e6e
Showing
83 changed files
with
1,423 additions
and
788 deletions.
There are no files selected for viewing
Binary file modified
BIN
+54 Bytes
(100%)
...one/build/Debug-iphonesimulator/KitchenSink.app.dSYM/Contents/Resources/DWARF/KitchenSink
Binary file not shown.
Binary file modified
BIN
-27 Bytes
(96%)
0.8.1/KitchenSink/build/iphone/build/Debug-iphonesimulator/KitchenSink.app/Info.plist
Binary file not shown.
Binary file modified
BIN
-12 Bytes
(100%)
0.8.1/KitchenSink/build/iphone/build/Debug-iphonesimulator/KitchenSink.app/KitchenSink
Binary file not shown.
Binary file modified
BIN
+16 Bytes
(100%)
0.8.1/KitchenSink/build/iphone/build/Debug-iphonesimulator/KitchenSink.app/MainWindow.nib
Binary file not shown.
19 changes: 10 additions & 9 deletions
19
...ld/iphone/build/KitchenSink.build/Debug-iphonesimulator/KitchenSink.build/KitchenSink.dep
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
Binary file modified
BIN
+8 Bytes
(100%)
...nk.build/Debug-iphonesimulator/KitchenSink.build/Objects-normal/i386/ApplicationRouting.o
Binary file not shown.
Binary file modified
BIN
+8 Bytes
(100%)
...uild/KitchenSink.build/Debug-iphonesimulator/KitchenSink.build/Objects-normal/i386/main.o
Binary file not shown.
780 changes: 312 additions & 468 deletions
780
...ld/iphone/build/KitchenSink.build/Debug-iphonesimulator/KitchenSink.build/build-state.dat
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
var win = Titanium.UI.currentWindow; | ||
|
||
|
||
var label = Ti.UI.createLabel({ | ||
text:'No app event received. Make call while running app', | ||
textAlign:'center', | ||
width:'auto' | ||
}); | ||
|
||
win.add(label); | ||
|
||
var paused = false; | ||
|
||
Titanium.App.addEventListener('pause',function(e) | ||
{ | ||
paused = true; | ||
label.text = "App has been paused"; | ||
}); | ||
|
||
Titanium.App.addEventListener('resume',function(e) | ||
{ | ||
if (paused) | ||
{ | ||
label.text = "App has resumed"; | ||
} | ||
else | ||
{ | ||
label.text = "App has resumed (w/o pause)"; | ||
} | ||
}); | ||
|
||
|
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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
var win = Titanium.UI.currentWindow; | ||
|
||
|
||
var username = Ti.UI.createTextField({ | ||
autocapitalization:Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE, | ||
width:300, | ||
top:10, | ||
height:35, | ||
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED, | ||
hintText:'Foursquare Username' | ||
}); | ||
win.add(username); | ||
|
||
var password = Ti.UI.createTextField({ | ||
autocapitalization:Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE, | ||
width:300, | ||
top:55, | ||
height:35, | ||
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED, | ||
passwordMask:true, | ||
hintText:'Foursquare Password' | ||
}); | ||
win.add(password); | ||
|
||
var button = Titanium.UI.createButton({ | ||
title:'Get Venues Nearby', | ||
top:100, | ||
width:300, | ||
height:40 | ||
}); | ||
win.add(button); | ||
|
||
var navActInd = Titanium.UI.createActivityIndicator(); | ||
win.setRightNavButton(navActInd); | ||
|
||
button.addEventListener('click', function() | ||
{ | ||
label.text = "Determining your location..."; | ||
navActInd.show(); | ||
password.blur(); | ||
Ti.API.info("starting geo"); | ||
Titanium.Geolocation.getCurrentPosition(function(e) | ||
{ | ||
Ti.API.info("received geo response"); | ||
if (e.error) | ||
{ | ||
alert(e.error); | ||
return; | ||
} | ||
|
||
var longitude = e.coords.longitude; | ||
var latitude = e.coords.latitude; | ||
|
||
label.text = "You are at: "+longitude+"\n"+latitude+"\n\nFinding venues..."; | ||
|
||
var xhr = Titanium.Network.createHTTPClient(); | ||
xhr.onerror = function(e) | ||
{ | ||
Ti.API.info("ERROR " + e.error); | ||
navActInd.hide(); | ||
alert(e.error); | ||
} | ||
xhr.onload = function() | ||
{ | ||
label.hide(); | ||
// Ti.API.info("foursquare response was "+this.responseText); | ||
|
||
var resp = eval('('+this.responseText+')'); | ||
var venues = resp.groups[0].venues; | ||
for (var i=0;i<venues.length;i++) | ||
{ | ||
status.text += venues[i].name+'\n\n'; | ||
|
||
} | ||
scrollView.add(status); | ||
|
||
navActInd.hide(); | ||
}; | ||
// open the client and encode our URL | ||
xhr.open('GET','http://api.foursquare.com/v1/venues.json?geolat='+latitude+'&geolong='+longitude); | ||
// base64 encode our Authorization header | ||
xhr.setRequestHeader('Authorization','Basic '+Ti.Utils.base64encode(username.value+':'+password.value)); | ||
|
||
// send the data | ||
xhr.send(); | ||
Ti.API.info("sending foursquare API request for "+latitude+","+longitude); | ||
}); | ||
}); | ||
var scrollView = Titanium.UI.createScrollView({ | ||
top:150, | ||
contentHeight:'auto', | ||
contentWidth:'auto', | ||
backgroundColor:'#13386c', | ||
width:300, | ||
height:200, | ||
borderRadius:10 | ||
}); | ||
win.add(scrollView); | ||
|
||
var label = Titanium.UI.createLabel({ | ||
text:'Please login', | ||
font:{fontSize:18}, | ||
color:'white', | ||
width:250, | ||
height:'auto', | ||
textAlign:'center' | ||
}); | ||
scrollView.add(label); | ||
|
||
var status = Titanium.UI.createLabel({ | ||
font:{fontSize:18}, | ||
color:'white', | ||
width:250, | ||
height:'auto', | ||
top:20, | ||
text:'', | ||
textAlign:'center' | ||
}); | ||
|
||
|
||
|
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 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 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 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 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
Oops, something went wrong.