This file contains hidden or 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
| // by Alan Leard | |
| var win = Ti.UI.createWindow({ backgroundColor: '#000' }); | |
| var hide = false; | |
| win.addEventListener('click', function(){ | |
| if(hide){ | |
| Titanium.UI.iPhone.showStatusBar({animated:true, animationStyle: | |
| Titanium.UI.iPhone.StatusBar.ANIMATION_STYLE_FADE}); | |
| hide = false; | |
| } else { | |
| Titanium.UI.iPhone.hideStatusBar({animated:true, animationStyle: |
This file contains hidden or 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.createWindow({ | |
| navBarHidden: true, | |
| backgroundColor: 'blue' | |
| }); | |
| win.open(); | |
| var button = Ti.UI.createButton({ | |
| title: 'Get PDF', | |
| height: 50, | |
| width: 200, |
This file contains hidden or 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.createWindow({ | |
| backgroundColor : 'white', | |
| fullscreen : true | |
| }); | |
| var button = Ti.UI.createButton({ | |
| title : 'test', | |
| height : 60, | |
| width : 200 | |
| }); | |
| win.add(button); |
This file contains hidden or 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.createWindow({ | |
| backgroundColor : 'white', | |
| fullscreen : true | |
| }); | |
| var button = Ti.UI.createButton({ | |
| title : 'test', | |
| height : 60, | |
| width : 200 | |
| }); | |
| win.add(button); |
This file contains hidden or 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
| Titanium.Facebook.requestWithGraphPath('OBJECT_ID', {}, 'GET', function(e) { | |
| if (e.success) { | |
| alert(e.result); | |
| } else { | |
| return -1; | |
| } | |
| }); |
This file contains hidden or 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
| if(!Ti.App.Properties.hasProperty('notificationCount')) { | |
| Ti.App.Properties.setInt('notificationCount', 0); | |
| } else { | |
| Ti.App.Properties.removeProperty('notificationCount'); | |
| var activity = Ti.Android.currentActivity(); | |
| var intent = Ti.Android.createIntent({ | |
| action : Ti.Android.ACTION_MAIN, | |
| // you can use className or url to launch the app | |
| // className can be found by looking in the build folder |
This file contains hidden or 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 = Titanium.UI.createWindow({ | |
| backgroundColor: 'blue' | |
| }); | |
| var btn = Ti.UI.createButton({ | |
| title : 'Add Notification' | |
| }); | |
| btn.addEventListener('click', function(e) { | |
| var activity = Ti.Android.currentActivity(); |
This file contains hidden or 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
| // GLOBAL SCOPE | |
| var win = Ti.UI.createWindow(); | |
| var parentView = Ti.UI.createView(); | |
| var childView = Ti.UI.createView(); | |
| parentView.add(childView); | |
| win.add(parentView); | |
| win.open(); | |
This file contains hidden or 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 win1 = Titanium.UI.createWindow({ | |
| title : 'Tab 1', | |
| backgroundColor : '#fff', | |
| fullscreen: true, | |
| }); | |
| // orientationModes needs to be set after the createWindow | |
| win1.orientationModes = [Ti.UI.PORTRAIT]; | |
| var b1 = Titanium.UI.createButton({ | |
| title : 'Win 2', |
This file contains hidden or 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.createWindow({ | |
| backgroundColor : 'white' | |
| }); | |
| win.open(); | |
| var button = Ti.UI.createButton({ | |
| title : "Click me!", | |
| height : 50, | |
| width : 200, | |
| top : 100 |