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
| // namespace for the windows | |
| var W = {}; | |
| // namespace for custom UI | |
| var UI = {}; | |
| // store the tabs in this array for later use | |
| var tabs = []; | |
| // include the necessary files to run the app | |
| Ti.include('ui.js'); | |
| Ti.include('other.js'); | |
| Ti.include('window1.js'); |
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
| Ti.include('lib/htmlparser.js'); | |
| Ti.include('lib/soupselect.js'); | |
| var select = soupselect.select; | |
| var body = '<html><head><title>Test</title></head>' | |
| + '<body>' | |
| + '<img src="http://l.yimg.com/mq/i/home/HKGallery.gif" />' | |
| + '<div id="block">' | |
| + ' <div class="row">Row 1</div>' |
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
| /** | |
| * The following snippet will ask the user to rate your app the second time they launch it. | |
| * It lets the user rate it now, "Remind Me Later" or never rate the app. | |
| */ | |
| var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
| win.addEventListener('open', checkReminderToRate); | |
| win.add(Ti.UI.createLabel({ text: 'This is a simple app that will remind you to rate it.' })); | |
| win.open(); | |
| function checkReminderToRate() { |
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
| // this sets the background color of the master UIView (when there are no windows/tab groups on it) | |
| Titanium.UI.setBackgroundColor('#000'); | |
| Titanium.UI.iPhone.statusBarStyle = Titanium.UI.iPhone.StatusBar.OPAQUE_BLACK; | |
| // create tab group | |
| var tabGroup = Titanium.UI.createTabGroup(); | |
| // | |
| // create base UI tab and root window | |
| // |
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 window = Titanium.UI.createWindow({}); | |
| var feedsTable = Titanium.UI.createTableView({}); | |
| var playingPanel = Titanium.UI.createView({ | |
| bottom:-65, |
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 container = Ti.UI.createView({ | |
| layout:'vertical', | |
| top:5, left:5, right:5 | |
| }); | |
| var bar = Ti.UI.createView({ | |
| top:5, | |
| left:0, | |
| width:'75%', | |
| height:40, |
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
| /* The images for this example can be downloaded from http://j.mp/loadingimagesforti */ | |
| var win = Ti.UI.createWindow({ backgroundColor: '#f00'}); | |
| var loading = Ti.UI.createImageView({ | |
| images: [ | |
| 'images/loading/00.png', 'images/loading/01.png', 'images/loading/02.png', | |
| 'images/loading/03.png', 'images/loading/04.png', 'images/loading/05.png', | |
| 'images/loading/06.png', 'images/loading/08.png', 'images/loading/09.png', | |
| 'images/loading/10.png', 'images/loading/11.png' | |
| ], | |
| width: 33, height: 33 |
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.currentWindow; | |
| // Set the window orientation modes for the video to rotate with the device | |
| win.orientationModes = [ Ti.UI.PORTRAIT, Ti.UI.LANDSCAPE_LEFT, | |
| Ti.UI.LANDSCAPE_RIGHT ]; | |
| // Build the movie URL. 'fs' and 'autoplay' parameters are optional. | |
| var movieId = "d0llSyfgwEE"; | |
| var movieUrl = "http://www.youtube.com/embed/" + movieId+ "?fs=1&autoplay=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
| var win = Ti.UI.currentWindow; | |
| // Images to display (this list can be dynamically generated) | |
| var images = [ 'image1.png', 'image2.png', 'image3.png', 'image4.png', | |
| 'image5.png',' image6.png', 'image7.png', 'image8.png' ]; | |
| // Empty table data (will be populated at runtime) | |
| var data = []; | |
| var table = Ti.UI.createTableView(); |
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.Media.openPhotoGallery({ | |
| success:function(event){ | |
| var myImage = event.media; | |
| var xhr = Titanium.Network.createHTTPClient(); | |
| xhr.open('POST','http:// ------ /uploads.php'); | |
| xhr.onerror = function(e){alert(e.error);}; | |
| xhr.setTimeout(200000); |