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: '#fff' }); | |
| var button = Ti.UI.createButton({ title: 'Share' }); | |
| win.add(button); | |
| win.open(); | |
| button.addEventListener('click', function() { | |
| var intent = Ti.Android.createIntent({ | |
| action: Ti.Android.ACTION_SEND, | |
| type: 'text/plain' | |
| }); |
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 sample lets you record and share video with Appcelerator Titanium on Android. | |
| * REQUIRES THE 1.6.0 RC OF TITANIUM MOBILE SDK | |
| * http://developer.appcelerator.com/blog/2011/02/release-candidate-for-titanium-mobile-1-6-0.html | |
| */ | |
| /** | |
| * First, create our UI. We'll have two buttons: record, and share. | |
| */ | |
| var win = Titanium.UI.createWindow({ |
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: '#fff' }); | |
| var rotate = Ti.UI.create2DMatrix().rotate(90); | |
| var counterRotate = rotate.rotate(-180); | |
| var scrollView = Titanium.UI.createScrollableView({ | |
| views:[ | |
| Titanium.UI.createImageView({ image:'default_app_logo.png', transform: counterRotate }), | |
| Titanium.UI.createImageView({ image:'KS_nav_ui.png', transform: counterRotate }), | |
| Titanium.UI.createImageView({ image:'KS_nav_views.png', transform: counterRotate }) |
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: '#fff' }); | |
| win.add(Ti.UI.createLabel({ text: 'Type appcelerator.com in a browser, and this app will get launched. Try it!' })); | |
| 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 win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
| /** | |
| * Adds "swipe" event support to Android, and adds swipe up and down to iOS. | |
| * @param view The view that should be made swipeable. | |
| * @param allowVertical Whether or not vertical swipes (up and down) are allowed; default is false. | |
| * @param tolerance How much further you need to go in a particular direction before swipe is fired; default is 2. | |
| */ | |
| function makeSwipeable(view, allowVertical, tolerance) { | |
| tolerance = tolerance || 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
| // open a heavyweight window | |
| var win = Titanium.UI.createWindow({ backgroundColor: '#fff', fullscreen: true }); | |
| win.add(Ti.UI.createLabel({ text: 'Press your hardware menu button!' })); | |
| win.open(); | |
| // keep a pointer to the current activity | |
| var currentActivity = win.activity; | |
| // and make an options menu | |
| currentActivity.onCreateOptionsMenu = function(e) { |
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: '#fff' }); | |
| var html = '<html><body>' | |
| + '<a href="http://pedro.com">Pedro</a> ' | |
| + '<a href="http://is.com">is</a> ' | |
| + '<a href="http://a.com">a</a> ' | |
| + '<a href="http://balla.com">balla!</a>.' | |
| + '</body></html>'; | |
| var web = Ti.UI.createWebView({ |
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('overrideTabs.js'); | |
| /* | |
| This is a typical new project -- a tab group with three tabs. | |
| */ | |
| var tabGroup = Ti.UI.createTabGroup(); | |
| /* | |
| Tab 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
| ## | |
| # This script helps you run Titanium Mobile apps from the command line. | |
| # | |
| # You will want to customize the variables on lines 25-37, per your own environment. | |
| # Most important is to customize "appRootDirectory". | |
| # | |
| # It can be used a couple of different ways: | |
| # 1) To start the Android emulator: | |
| # ./t a | |
| # 2) To start a simulator, emulator, or deploy to device, use the following: |