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: 'white' | |
| }); | |
| var imgTableLoco = Ti.UI.createTableView({ | |
| width: 270, | |
| height: 290, | |
| top: 0, | |
| backgroundColor: 'black' | |
| }); |
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.currentWindow; | |
| var ind=Titanium.UI.createProgressBar({ | |
| width:200, | |
| height:50, | |
| min:0, | |
| max:1, | |
| value:0, | |
| style:Titanium.UI.iPhone.ProgressBarStyle.PLAIN, | |
| top:10, |
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: 'Look for the notification! It should be there now.' })); | |
| win.open(); | |
| Titanium.Android.NotificationManager.notify( | |
| 0, // <-- this is an ID that we can use to clear the notification later | |
| Ti.Android.createNotification({ | |
| contentTitle: 'Cheese, Gromit!', | |
| contentText: 'Swiss', | |
| tickerText: 'Our app made a notification!', |
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
| /** | |
| * Define our parser class. It takes in some text, and then you can call "linkifyURLs", or one of the other methods, | |
| * and then call "getHTML" to get the fully parsed text back as HTML! | |
| * @param text that you want parsed | |
| */ | |
| function Parser(text) { | |
| var html = text; | |
| var urlRegex = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi; |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
| package="com.test.AndroidOrientation" android:versionCode="1" | |
| android:versionName="1"> | |
| <uses-sdk android:minSdkVersion="8" /> | |
| <!-- TI_MANIFEST --> | |
| <application android:icon="@drawable/appicon" | |
| android:label="AndroidOrientation" android:name="AndroidorientationApplication" |
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
| --- | |
| name: Titanium.UI | |
| extends: Titanium.Module | |
| methods: | |
| - name: createListView | |
| summary: creates a new instance of [View](Titanium.UI.ListView) | |
| parameters: | |
| - name: parameters | |
| type: Dictionary<Titanium.UI.ListView> |
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
| // get the collection object | |
| Alloy.Collections.instance("Fugitive"); | |
| // delete all items | |
| Alloy.Collections.Fugitive.deleteAll(); |
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
| function removeAllChildren(viewObject){ | |
| //copy array of child object references because view's "children" property is live collection of child object references | |
| var children = viewObject.children.slice(0); | |
| for (var i = 0; i < children.length; ++i) { | |
| viewObject.remove(children[i]); | |
| } | |
| } |