Skip to content

Instantly share code, notes, and snippets.

@minhnc
minhnc / ui-min.js
Created December 28, 2011 10:54
Titanium UI Components
var _0xd3fc=["\x70\x72\x6F\x67\x72\x65\x73\x73\x42\x61\x72","\x76\x69\x65\x77","\x77\x69\x64\x74\x68","\x68\x65\x69\x67\x68\x74","\x62\x61\x63\x6B\x67\x72\x6F\x75\x6E\x64\x49\x6D\x61\x67\x65","\x63\x72\x65\x61\x74\x65\x56\x69\x65\x77","\x55\x49","\x62\x6F\x72\x64\x65\x72\x52\x61\x64\x69\x75\x73","\x63\x72\x65\x61\x74\x65\x49\x6D\x61\x67\x65\x56\x69\x65\x77","\x61\x64\x64","\x61\x75\x74\x6F","","\x66\x6F\x6E\x74","\x63\x6F\x6C\x6F\x72","\x63\x72\x65\x61\x74\x65\x4C\x61\x62\x65\x6C","\x69\x6E\x69\x74","\x73\x68\x6F\x77","\x63\x68\x69\x6C\x64\x72\x65\x6E","\x74\x65\x78\x74","\x72\x75\x6E","\x72\x6F\x75\x6E\x64","\x66\x69\x6E\x69\x73\x68","\x68\x69\x64\x65"];var _0x5197=[_0xd3fc[0],_0xd3fc[1],_0xd3fc[2],_0xd3fc[3],_0xd3fc[4],_0xd3fc[5],_0xd3fc[6],_0xd3fc[7],_0xd3fc[8],_0xd3fc[9],_0xd3fc[10],_0xd3fc[11],_0xd3fc[12],_0xd3fc[13],_0xd3fc[14],_0xd3fc[15],_0xd3fc[16],_0xd3fc[17],_0xd3fc[18],_0xd3fc[19],_0xd3fc[20],_0xd3fc[21],_0xd3fc[22]];exports[_0x5197[0]]=function (_0xa442x2,_0xa442x3,_0xa442x4){var _0xa442x5=this;t
@minhnc
minhnc / app.js
Created December 28, 2011 10:55
Titanium UI Components
var win = Ti.UI.createWindow({
backgroundColor:'#BABABA'
});
var ui = require('modules/ui-min'),
progressBar = new ui.progressBar(
{width: 300, height: 27, backgroundImage: 'assets/images/full_bar.png'},
{backgroundImage: 'assets/images/bar.jpg', borderRadius: 3},
{font: {fontFamily: 'Arial', fontSize: 15, fontWeight: 'bold'}, color: '#fff'}
);
@minhnc
minhnc / app.js
Created December 28, 2011 11:14
Titanium UI Components
var win = Ti.UI.createWindow({
backgroundColor:'#BABABA'
});
var ui = require('modules/ui-min'),
progressBar = new ui.progressBar(
{width: 300, height: 27, backgroundImage: 'assets/images/full_bar.png'},
{backgroundImage: 'assets/images/bar.jpg', borderRadius: 3},
{font: {fontFamily: 'Arial', fontSize: 15, fontWeight: 'bold'}, color: '#fff'}
);
@minhnc
minhnc / app.js
Created February 10, 2012 23:28
Titanium Custom Row
function populateData() {
var currentWin = Ti.UI.createWindow();
var table = Ti.UI.createTableView();
var tableData = [];
var rows = [
{title: 'Title 1', start_dt: 'start_dt 1', hasChild: true},
{title: 'Title 2', start_dt: 'start_dt 2', hasChild: true},
{title: 'Title 3', start_dt: 'start_dt 3', hasChild: true},
{title: 'Title 4', start_dt: 'start_dt 4', hasChild: true},
@minhnc
minhnc / app.js
Created February 14, 2012 09:12
app.js
var w1 = Ti.UI.createWindow({url:'win1.js', backgroundColor:'white'});
var w2 = Ti.UI.createWindow({url:'win2.js', backgroundColor:'white'});
var t1 = Ti.UI.createTab({window:w1, title: 'Tab1'});
var t2 = Ti.UI.createTab({window:w2, title: 'Tab2'});
var tg = Ti.UI.createTabGroup();
tg.addTab(t1);
tg.addTab(t2);
tg.open();
@minhnc
minhnc / win1.js
Created February 14, 2012 09:13
win1.js
var win = Ti.UI.currentWindow;
var tf1 = Titanium.UI.createTextField({
color : '#336699',
height : 35,
top : 100,
// left : 100,
width : 250,
// top : 300, ---
borderStyle : Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
@minhnc
minhnc / win2.js
Created February 14, 2012 09:14
win2.js
var win = Ti.UI.currentWindow;
function doDbThing() {
var db = Titanium.Database.open('doctor_names');
var data = [];
var rows = db.execute('SELECT * FROM doctor ORDER BY name');
while(rows.isValidRow()) {
@minhnc
minhnc / app.js
Created February 14, 2012 23:42
app.js
/*
* APP.JS
*/
// This file is functioning as a bootstrap file that loads my application's first component (ie. TabGroup). Created as to not pollute the global namespace.
var studiospace = {}; // define app's namespace
Ti.include('ui.js'); // include UI code
@minhnc
minhnc / ui.js
Created February 14, 2012 23:42
ui.js
/*
* POSSIBLE SOLUTION for the user session integration?
*/
// This sets the status bar style and background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.iPhone.statusBarStyle = Titanium.UI.iPhone.StatusBar.TRANSLUCENT_BLACK;
Titanium.UI.setBackgroundColor('#000');
(function(){
studiospace.ui = {};
@minhnc
minhnc / app.js
Created February 15, 2012 00:31
app.js
function populateData() {
var currentWin = Ti.UI.createWindow();
var table = Ti.UI.createTableView();
var tableData = [];
// Init some data
var db = Titanium.Database.open('fullsched');
db.execute('CREATE TABLE IF NOT EXISTS events (title TEXT, start_dt TEXT, hasChild INTEGER)');
for (var i = 0; i < 10; i++) {