Skip to content

Instantly share code, notes, and snippets.

@TheBrousse
TheBrousse / image_list.js
Created May 4, 2011 16:27
Titanium Image List View
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();
@TheBrousse
TheBrousse / tiapp.xml
Created March 10, 2013 16:19
To use Holo theme on Andriod, simply add the following in your tiapp.xml file. You are using a device that does not support this theme, it will fallack to the default theme on 2.x automatically.
<android xmlns:android="http://schemas.android.com/apk/res/android">
<tool-api-level>16</tool-api-level>
<manifest android:installLocation="preferExternal"
android:versionCode="3" android:versionName="1.0.2">
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="16"/>
<application android:theme="@android:style/Theme.Holo">
<activity
android:configChanges="keyboardHidden|orientation"
android:name="org.appcelerator.titanium.TiActivity"
android:screenOrientation="portrait"
@TheBrousse
TheBrousse / util.js
Created July 27, 2014 20:06
nappDrawer on Android
exports.SwapView = function(controllerToShow) {
// Remove the controllers.view from centerWindow
if (OS_ANDROID) {
Alloy.Globals.navbar.remove(Alloy.Globals.centerView.getView());
// Destroy the old controller
Alloy.Globals.centerView.destroy();
Alloy.Globals.centerView = null;
Ti.API.debug('SwapView.centerView: ' + Alloy.Globals.centerView);
}
@TheBrousse
TheBrousse / index.js
Created August 10, 2014 20:23
Android URL scheme
if (OS_ANDROID) {
var activity = Ti.Android.currentActivity;
var data = activity.getIntent().getData();
if (data) {
// You can parse your params here
var params = urlToObject(data);
Ti.API.info('Do you own thing...');
}