Skip to content

Instantly share code, notes, and snippets.

View srahim's full-sized avatar

Sabil Rahim srahim

  • Appcelerator
  • Mountain View, CA
View GitHub Profile
@srahim
srahim / app.js
Created January 17, 2012 19:51
TIMOB-6939
var win = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff',
});
var scrollView = Titanium.UI.createScrollView({
contentWidth:'auto',
contentHeight:'auto',
top:0,
showVerticalScrollIndicator:true,
- name: setContentOffset
summary: |
Sets the value of [contentOffset](Titanium.UI.ScrollView.contentOffset) property.
In iOS, there is an additional parameter `animated` that can be set to true/false to turn ON/OFF the animation while changing the
contents Offset. Forexample setcontentOffset({x:50,y:100},{animated:true})
@srahim
srahim / drillbit console
Created January 25, 2012 19:23
error on drillbit
D/AndroidRuntime( 263): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 263): CheckJNI is ON
D/AndroidRuntime( 263): --- registering native functions ---
W/ActivityManager( 60): Unable to find instrumentation info for: ComponentInfo{org.appcelerator.titanium.testharness/org.appcelerator.titanium.drillbit.TestHarnessRunner}
I/AndroidRuntime( 263): AndroidRuntime onExit calling exit(1)
@srahim
srahim / drillbit console
Created January 25, 2012 19:29
error on drillbit
D/AndroidRuntime( 277):
D/AndroidRuntime( 277): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 277): CheckJNI is ON
D/AndroidRuntime( 277): --- registering native functions ---
D/PackageParser( 60): Scanning package: /data/app/vmdl59119.tmp
W/ResourceType( 60): Bad string block: last string is not 0-terminated
W/PackageParser( 60): /data/app/vmdl59119.tmp (at Binary XML file line #5): Requires newer sdk version #8 (current version is #7)
D/AndroidRuntime( 277): Shutting down VM
D/dalvikvm( 277): DestroyJavaVM waiting for non-daemon threads to exit
D/dalvikvm( 277): DestroyJavaVM shutting VM down
@srahim
srahim / app.js
Created January 31, 2012 23:38
ScrollView GetcontentOFfset
var win = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff',
});
var scrollView = Titanium.UI.createScrollView({
contentWidth:'auto',
contentHeight:'auto',
top:0,
showVerticalScrollIndicator:true,
@srahim
srahim / app.js
Created April 17, 2012 00:30
ScrollEnd test on tableveiw
var win = Ti.UI.createWindow();
var data = [
{title:"Row 1"},
{title:"Row 2"},
{title:"Row 3"}
];
var tableView = Ti.UI.createTableView({
data: data
@srahim
srahim / app.js
Created April 17, 2012 20:25
Camera Overlay
var win = Titanium.UI.createWindow();
function getOrientation(o)
{
switch (o)
{
case Titanium.UI.PORTRAIT:
return 'portrait';
case Titanium.UI.UPSIDE_PORTRAIT:
return 'reverse portrait';
@srahim
srahim / app.js
Created April 18, 2012 21:11
PULL TO REFRESH
var win = Ti.UI.createWindow();
function formatDate()
{
var date = new Date();
var datestr = date.getMonth()+'/'+date.getDate()+'/'+date.getFullYear();
if (date.getHours()>=12)
{
datestr+=' '+(date.getHours()==12 ? date.getHours() : date.getHours()-12)+':'+date.getMinutes()+' PM';
}
@srahim
srahim / app.js
Created April 24, 2012 18:13
Overlay rotate animation.
var win = Titanium.UI.createWindow();
var t = Ti.UI.create2DMatrix();
var identityTransform = Ti.UI.create2DMatrix();
var a = Titanium.UI.createAnimation();
a.transform = t;
a.duration = 1000;
//Function to process the current orientation
@srahim
srahim / app.js
Created May 11, 2012 18:43
ScrollableView customization.
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//