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('#000'); | |
// Create a window | |
var win = Titanium.UI.createWindow({ | |
title:'Web Test', | |
backgroundColor:'#fff' | |
}); | |
// and now a webView | |
var webview1 = Titanium.UI.createWebView({url:'somePage.html'}); |
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
// RATER MODULE for Appcelerator Titanium | |
/* | |
WHAT IS IT: | |
Create a cycling reminder to go rate your app at the App Store. Tracks | |
the app launch count, and reminds the user every 20 launches (configurable) to | |
rate the app, with a click to launch the app page in the App Store. | |
Reminders stop if the user clicks the "Rate Now" or "Don't Remind Me" options. | |
USAGE: |
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
// Kosso imageAsCropped | |
// added to TiBlob.m | |
// requires 4 arguments : x, y, width, height | |
- (id)imageAsCropped:(id)args | |
{ | |
[self ensureImageLoaded]; | |
if (image!=nil) | |
{ | |
ENSURE_ARG_COUNT(args,4); |
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
// testend on iOS | |
/* | |
Copyright 2011 Pedro Enrique | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
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
/* Kosso : March 12th 2011 | |
This the only way I managed to do this without the app crashing on resume. | |
Done slightly differently to the KS example, since they unregister the service and | |
do not use a setInterval timer. | |
*/ | |
//############ in app.js : | |
// test for iOS 4+ |
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 utcDate(e){ | |
var day = e.getUTCDate(); | |
var month = e.getUTCMonth()+1; | |
var year = e.getUTCFullYear(); | |
var hour = e.getUTCHours(); | |
var minutes = e.getUTCMinutes(); | |
var seconds = e.getUTCSeconds(); | |
if(month<10){month = '0'+month;} | |
if(day<10){day = '0'+day;} | |
if(hour<10){hour = '0'+hour;} |
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
// Created by @pecdev with the help of @pec1985 | |
// Follow either on Twitter | |
// | |
// Center the title of a row with the Super Cool Row function | |
var tableData = []; | |
function mySuperCoolRow(e){ | |
var row = Ti.UI.createTableViewRow({backgroundColor:e.bgColor,height:e.height}); | |
var label = Ti.UI.createLabel({text:e.title,width:'auto',height:50,font:{fontSize:20,fontWeight:'bold'}}); |
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 Mobile code for slider control functionality | |
//---------------------------------------- | |
// @CJ_Reed 23rd Dec 2010 | |
var sliderView = Titanium.UI.createView({top:100,height:50,left: 40,width:240,backgroundColor:'#000'}); | |
var sliderButton = Titanium.UI.createView({width:96,borderRadius:5,backgroundColor:'#bbb',height:sliderView.height,left:sliderView.left,top:sliderView.top}); | |
Titanium.UI.currentWindow.add(sliderView); | |
Titanium.UI.currentWindow.add(sliderButton); | |
function unlock (){ |
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
// CJ_Reed, 9th Apr 2011 | |
// --------------------- | |
// Storing date/time properties in Titanium Mobile | |
// (Rather than convert to text and back) | |
// create array and insert date/time value | |
var rightNowArray = []; | |
var rightNow = new Date(); | |
rightNowArray.push({time:rightNow}); |
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
/* Ever wondered how to get the nice column of letters in the right side | |
* of the table view? | |
* | |
* Here is an example: | |
* 1. We take a list of names from a json file | |
* 2. We need to sort them by either first name or last name | |
* 3. We need to create a row header once in a while, when the first letter changes | |
* 4. We need to create a table index | |
* | |
*/ |
OlderNewer