Skip to content

Instantly share code, notes, and snippets.

View jonalter's full-sized avatar

Jonathan Alter jonalter

View GitHub Profile
@jonalter
jonalter / app.js
Created July 28, 2011 16:25
iOS: Activity indicator on the splash screen
var win = Ti.UI.createWindow({
backgroundColor: 'blue'
});
var actInd = Titanium.UI.createActivityIndicator({
bottom:100,
height:50,
width:10,
style:Titanium.UI.iPhone.ActivityIndicatorStyle.PLAIN,
font: {fontFamily:'Helvetica Neue', fontSize:15,fontWeight:'bold'},
@jonalter
jonalter / app.js
Created August 4, 2011 00:35
Test writing files to filesystem
var win = Ti.UI.createWindow({
backgroundColor: 'blue',
layout: 'vertical'
});
var testFile;
var label = Ti.UI.createLabel({
top: 10,
height: 100,
@jonalter
jonalter / app.js
Created August 5, 2011 21:27
CoverFlowView with borders on images
var win = Ti.UI.createWindow({
backgroundColor: 'blue'
});
var images = [];
for (var c=0;c<30;c++)
{
var iv = Ti.UI.createImageView({
image: 'imageview/'+c+'.jpg',
borderColor: 'red',
@jonalter
jonalter / app.js
Created August 10, 2011 01:30
CoverFlowView with borders on remote images
var win = Ti.UI.createWindow({
backgroundColor: 'blue'
});
var getImage = function(e){
var iv = Ti.UI.createImageView({
image: 'http://example.com/'+e+'.jpg',
borderColor: 'red',
borderWidth: 5,
top: 1000
@jonalter
jonalter / app.js
Created August 16, 2011 19:28
iOS: simple drag and drop example
var win = Ti.UI.createWindow({
backgroundColor: 'white',
fullscreen: true,
orientationModes: [1,2,3,4]
});
var image = Ti.UI.createImageView({
width:50,
height:100,
image:"http://images.allocine.fr/r_160_214/b_1_cfd7e1/medias/nmedia/18/35/94/63/18458444.jpg",
@jonalter
jonalter / app.js
Created August 31, 2011 22:03
Ti.App.iOS.scheduleLocalNotification example
var win = Ti.UI.createWindow({
backgroundColor:'white'
});
win.open();
var label = Ti.UI.createLabel({
top: 20,
height: 200,
width: 200,
text: "Background the app"
});
@jonalter
jonalter / app.js
Created September 6, 2011 20:35
Android: exitOnClose
var win1 = Ti.UI.createWindow({
backgroundColor : 'white',
fullscreen: true,
exitOnClose: true
});
var button = Ti.UI.createButton({
title : 'Open',
width : 150,
height : 40,
@jonalter
jonalter / app.js
Created September 6, 2011 23:03
Android/iOS: copy folder with contents
var win = Ti.UI.createWindow({
backgroundColor : '#fff',
layout : 'vertical'
});
var testButton = Ti.UI.createButton({
title : "Copy Folder",
top : 20,
height : 50,
width : 250,
@jonalter
jonalter / AndroidManifest.xml
Created September 8, 2011 17:31
Android: app and splash screen orientation with TiSDK 1.7.2 (must use custom AndroidManifest.xml)
<!-- add android:screenOrientation="portrait" to the main activity -->
<!-- This sets the splash screen -->
<activity android:name=".Test1Activity" android:screenOrientation="portrait"
android:label="Test1" android:theme="@style/Theme.Titanium"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
@jonalter
jonalter / tiapp.xml
Created September 8, 2011 20:36
Android: splash screen orientation set from tiapp.xml as of Sep 8 2011 11:25 r5be876f7 1.8.0
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>
<supports-screens android:anyDensity="false"/>
<application android:debuggable="true">
<activity android:alwaysRetainTaskState="true"
android:name=".TitestActivity"
android:configChanges="keyboardHidden|orientation"
android:screenOrientation="portrait"
android:theme="@style/Theme.Titanium">
<intent-filter>