Skip to content

Instantly share code, notes, and snippets.

var splash = Ti.UI.currentWindow;
// do whatever you want.. animations.. put a label "loading..." and animate it (remember to play with delays and durations to make this screen last longer)
// and when you finish loading, just change the active tab.
splash.tabGroup.setActiveTab(splash.mainTab);
@LearningTitanium
LearningTitanium / app.js
Created April 23, 2012 20:22
FaceTouch
Titanium.App.ISIPAD = Ti.Platform.osname == 'ipad';
Ti.include('/programs/main.js');
var ff = {};
ff.app = {};
ff.ui = {};
// create tab group
ff.app.tabGroup = Titanium.UI.createTabGroup({
backgroundColor: '#000'
@LearningTitanium
LearningTitanium / Sample 6
Created February 13, 2012 07:25
Titanium Dictionary Module
var referenceLibrary = require('bencoding.dictionary').createReferenceLibrary();
Ti.API.info("This feature is only supported in iOS5 and above");
Ti.API.info("Check if we have the min OS version needed");
Ti.API.info("Is Supported? => " + referenceLibrary.isSupported());
Ti.API.info("Check if Apple knows the definition for fanboy");
var hasDefinition = referenceLibrary.wordHasDefinition('fanboy');
Ti.API.info("Term has definition =>" + hasDefinition);
if(!hasDefinition){
alert('You can still call showDialog it will just display a message that no definition was found');
@LearningTitanium
LearningTitanium / Sample 5
Created February 13, 2012 07:14
BenCoding Titanium SMS Module
//Create SMSDialog object
var sms = require('bencoding.sms').createSMSDialog({ barColor:'#336699' });
Ti.API.info("Is This Feature Supported? => " + sms.canSendText);
//This is an example of how to check if the device can send Text Messages
if(!sms.canSendText){
var noSupport = Ti.UI.createAlertDialog({
title:'Not Supported',
message:"This device doesn't support sending text messages"
}).show();
@LearningTitanium
LearningTitanium / createActivityIndicator
Created September 11, 2011 23:05
createActivityIndicator on titanium
var win = Titanium.UI.createWindow({
title:'Learning Titanium - Activity Inticator',
backgroundColor:'#ccc'
});
var actInd = Ti.UI.createActivityIndicator({
width:50,
height:50,
message: 'Hello there!',
color: 'FF0000'