This file contains hidden or 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
# Make sure you add the -Xmx512M options or jython will throw a heap exception | |
# METHOD 1 | |
import zipfile, os, sys | |
z = zipfile.ZipFile(sys.argv[1]) | |
for name in z.namelist(): | |
destdir = os.path.dirname(name) | |
if not os.path.isdir(destdir) : | |
os.makedirs(destdir) |
This file contains hidden or 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
<!-- HTML and CSS --> | |
<html> | |
<head> | |
<title>Declarative UI Master Detail Test</title> | |
<script src="/controller/index.js"></script> | |
</head> | |
<body> | |
<div id="mainWindow" data-ti-api="Window" style="-ti-navBarHidden:false;"> | |
<div id="header" data-ti-api="View"> | |
<div id="title" data-ti-api="Label" style="-ti-text:'My Title';"></div> |
This file contains hidden or 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
var win = Ti.UI.createWindow({ | |
backgroundColor: '#fff', | |
exitOnClose: true, | |
navBarHidden: false | |
}); | |
win.open(); |
This file contains hidden or 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
<div id="tableview" data-ti-api="TableView" data-ti-datasource="/model/mydata"> | |
<div data-ti-api="RowRenderer"> | |
<div data-ti-api="Label" style="{objectname}"></div> | |
</div> | |
</div> |
This file contains hidden or 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
var win = Ti.UI.createWindow({ | |
backgroundColor: '#fff', | |
exitOnClose: true, | |
navBarHidden: false | |
}); | |
win.open(); |
This file contains hidden or 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
var Alloy = require("alloy"), _ = Alloy._, A$ = Alloy.A, M$ = Alloy.M, BC$ = Alloy.Backbone.Collection, TFL$ = Ti.UI.FILL, TSZ$ = Ti.UI.SIZE, $ = {}; | |
$.master = A$(Ti.UI.createWindow({ | |
backgroundColor: "white", | |
layout: "vertical", | |
id: "master" | |
}), "Window"), $.table = A$(Ti.UI.createTableView({ | |
id: "table" | |
}), "TableView", $.master), $.master.add($.table), function(exports) { | |
$.table.setData([ Ti.UI.createTableViewRow({ |
This file contains hidden or 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
@Kroll.getProperty @Kroll.method | |
public String getSize() { | |
switch(TiApplication.getInstance().getApplicationContext().getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) { | |
case Configuration.SCREENLAYOUT_SIZE_SMALL : | |
return "small"; | |
case Configuration.SCREENLAYOUT_SIZE_NORMAL : | |
return "normal"; | |
case Configuration.SCREENLAYOUT_SIZE_LARGE : | |
return "large"; | |
case 4 : // Configuration.SCREENLAYOUT_SIZE_XLARGE (API 9) |
This file contains hidden or 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
var win = Ti.UI.createWindow({ | |
backgroundColor: '#fff', | |
fullscreen: false, | |
exitOnClose: true | |
}); | |
var view1 = Ti.UI.createView({ | |
height: 200, | |
width: 200, | |
left: 30, |
This file contains hidden or 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
export.module = Alloy.getController('BaseController').extend({ | |
// preLayout() is optional. It's safe to delete. | |
preLayout: function(args) {} | |
// postLayout() is also optional, but most often all your app | |
// logic will be contained in this function. | |
postLayout: function(args) {} | |
}); |
This file contains hidden or 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
module.exports = Alloy.getController('BaseController').extend({ | |
// rarely used | |
preLayout: function(args){}, | |
// where 98% of the code will go | |
postLayout: function(args) { | |
$.label.text = 'here i am'; | |
// other controller code | |
}, |