Skip to content

Instantly share code, notes, and snippets.

var window = Titanium.UI.createWindow({
backgroundColor:'red'
});
var view = Titanium.UI.createView({
backgroundColor:"blue"
});
var x = [ 1,2,3,4,5,6 ];
view.myArray = x;
807 TiRootActivity I (Thread-9) [19,19] eval app.js
807 KrollContext D (kroll$1) [11,30] Running evaluated script: app://app.js
61 ActivityManager I Displayed activity com.testing.weatherapp/.WeatherappActivity: 3736 ms (total 3736 ms)
807 TiAPI I (kroll$1) [1144,1174] view.myArray[3] = 4
807 TiAPI I (kroll$1) [2,1176] view.myArray type = object
807 TiAPI I (kroll$1) [5,1181] x type isArray = true
807 dalvikvm D GC_FOR_MALLOC freed 4782 objects / 322768 bytes in 124ms
807 KrollContext E (kroll$1) [708,1889] ECMA Error evaluating source: TypeError: Cannot call method "toString" of undefined
(app://app.js#14)
807 KrollContext E org.mozilla.javascript.EcmaError: TypeError: Cannot call method "toString" of undefined (app://app.js#14
@hal-gh
hal-gh / gist:779846
Created January 14, 2011 16:40
Basic Animation Exception
893 AndroidRuntime D Shutting down VM
893 dalvikvm W threadid=1: thread exiting with uncaught exception (group=0x4001d800)
893 TiUncaughtHandler E (main) [59,33533] Sending event: exception on thread: main msg:java.lang.IllegalStateException: call to
getView on a Window; Titanium 1.5.2,2011/01/11 12:45,e8ed10...
893 TiUncaughtHandler E java.lang.IllegalStateException: call to getView on a Window
893 TiUncaughtHandler E at ti.modules.titanium.ui.WindowProxy.getView(WindowProxy.java:57)
893 TiUncaughtHandler E at org.appcelerator.titanium.util.TiAnimationBuilder.render(TiAnimationBuilder.java:176)
893 TiUncaughtHandler E at org.appcelerator.titanium.util.TiAnimationBuilder.render(TiAnimationBuilder.java:133)
893 TiUncaughtHandler E at org.appcelerator.titanium.view.TiUIView.processProperties(TiUIView.java:419)
893 TiUncaughtHandler E at ti.modules.titanium.ui.TiUIWindow.p
@hal-gh
hal-gh / LICENSE.txt
Created May 23, 2011 22:19 — forked from peterhil/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
Copyright (c) 2011 Peter Hillerström, http://peter.vasb.fi/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@hal-gh
hal-gh / app.js
Created May 27, 2011 19:03
local and remote webview demo
Titanium.UI.setBackgroundColor('#000');
var win1 = Titanium.UI.createWindow({
backgroundColor:'white',
exitOnClose:true,
layout:'vertical',
title:'win1: Main Window'
});
Ti.App.addEventListener('fromWebview',function(e){
data='<th scope="col" style="padding-top:0">Heading one</th> </tr><tr class="odd"> <td>May 2011</td> <td>dfgibwsd</td> ';
var regExArr = [
{
"regex":"<td.*>[\\S\\s]*</td>",
"modifier":"gi",
"action":"match"
}
]
var resultsArray = [];
for(var i=0,ilen=regExArr.length;i<ilen;i++){
@hal-gh
hal-gh / app.js
Created December 20, 2011 12:43
CommonJS Stateful Example
var stateful = require('statefulModule');
var score = require('scoreModule');
var window = Ti.UI.createWindow({
backgroundColor:'white',
fullscreen:false,
title:'Click window to score'
});
window.addEventListener('click', function() {
@hal-gh
hal-gh / gist:1513998
Created December 23, 2011 12:04
Tab test
Ti.UI.setBackgroundColor('#000');
var tabGroup = Ti.UI.createTabGroup();
var win1 = Ti.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var tab1 = Ti.UI.createTab({
title:'Tab 1',
@hal-gh
hal-gh / output
Created December 26, 2011 02:05
picker test
Titanium.UI.setBackgroundColor('#000');
var win1 = Ti.UI.createWindow({
backgroundColor:'white',
fullscreen:false,
exitOnClose:true
});
var minDate = new Date(2011,11,1);
@hal-gh
hal-gh / gist:1521318
Created December 26, 2011 14:55
tableview padding
var win = Ti.UI.createWindow({
backgroundColor: 'white',
fullscreen: false
});
var data = [];
for(var i=0;i<20;i++){
var descriptionRow = Ti.UI.createTableViewRow({
height:100,