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
Titanium.UI.setBackgroundColor('red'); | |
// root | |
var rootWin = Ti.UI.createWindow({ | |
title: 'Root Win', | |
backgroundColor: 'gray', | |
tabBarHidden: true, | |
navBarHidden: true | |
}); |
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
(function() { | |
var mainWindow, tableview; | |
function setupWindow() { | |
mainWindow = Titanium.UI.createWindow({ | |
title : 'Tab 1', | |
backgroundColor : '#fff' | |
}); |
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
qrScanButton.addEventListener("click", function(e) { | |
var intent = Ti.Android.createIntent({ | |
action: "com.google.zxing.client.android.SCAN" | |
}); | |
intent.putExtra("SCAN_MODE", "QR_SCAN_MODE"); | |
var activity = Ti.Android.currentActivity; | |
activity.startActivityForResult(intent, function(e) { | |
if (e.resultCode == Ti.Android.RESULT_OK) { | |
var contents = e.intent.getStringExtra("SCAN_RESULT"); | |
var format = e.intent.getStringExtra("SCAN_RESULT_FORMAT"); |
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
var activity = Ti.Android.currentActivity; | |
var win = Ti.UI.currentWindow; | |
activity.addEventListener("create", function(e) { | |
var button = Ti.UI.createButton({title: "Hello world"}); | |
button.addEventListener("click", function(e) { | |
activity.finish(); | |
}); | |
win.add(button); | |
}); |
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
// implement like this: | |
var window = Ti.UI.createWindow({ | |
backgroundColor:'#fff' | |
}); | |
// draw the gridlines first so your other elements stack on top of them | |
// without requiring you to set the z-index property of each | |
var grid = require('gridlines'); | |
grid.drawgrid(10,window); |
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
Titanium.App.addEventListener("playvideo", function (e) { | |
win11 = Titanium.UI.createWindow({ | |
orientationModes: [Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT], | |
title: "Video", | |
zIndex: 222222 | |
}); | |
var activeMovie = Titanium.Media.createVideoPlayer({ | |
fullscreen: !0, | |
autoplay: !0, |
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
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]); | |
} | |
} |
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
// get the collection object | |
Alloy.Collections.instance("Fugitive"); | |
// delete all items | |
Alloy.Collections.Fugitive.deleteAll(); |
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
--- | |
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 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" |
OlderNewer