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
<Alloy> | |
<View id="header"> | |
<View id="titleContainer"> | |
<Label id="title">title</Label> | |
<Label id="itemCount">3</Label> | |
<View id="caretIcon"/> | |
</View> | |
<Button id="addExpense" onClick="add"/> | |
</View> | |
</Alloy> |
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 _args = arguments[0] || {}; | |
$.title.text = _args.title; | |
$.title.itemCount = _args.count; | |
function add(e){ | |
Ti.API.info(JSON.stringify(_args)); | |
_args.addFunction; | |
} |
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
function addExpense(e){ | |
Ti.API.info("addExpense is called"); | |
alert("adding?"); | |
} | |
var header = Alloy.createController("itemHeader", { | |
title:"Expenses", | |
count:"3", | |
addFunction: addExpense | |
}); |
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
/** | |
* Global singleton | |
*/ | |
var APP = { | |
/** | |
* This sets up global events, persistant things | |
* throughout the app, etc. Only should be called | |
* when the app is booted. | |
*/ |
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 lineItemsSection = Ti.UI.createTableViewSection({ | |
headerView : lineItemsHeaderView | |
}); | |
var rows = []; | |
for(var i = 0; i < itemCount; i++) { | |
var tableViewRow = Ti.UI.createTableViewRow({ | |
id : "lineItemDetails", | |
data : data[i], |
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
-------content of app.js-------- | |
Ti.include('somefolder/platform.js'); | |
Ti.include('somefolder/API.js'); | |
Ti.include('somefolder/modules.js'); | |
Ti.include('somefolder/UI.js'); | |
MyApp = { | |
Platform:{}, | |
API:{}, | |
Modules:{}, |
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(); | |
var label1 = Ti.UI.createLabel | |
({ | |
text:'Some Documents listed', | |
font:{fontWeight:'bold', fontSize:14}, | |
color: '#8c0000', | |
height: 'auto', | |
left: 10, | |
top:10 |
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
/** | |
* A singleton object | |
* | |
* Singleton objects are useful but use them sparingly. By using singletons | |
* you are creating dependencies in your software that might not be necessary. | |
* If you find yourself using this over and over again you probably need | |
* to rethink what you're doing. Remember, in general, globals are bad. | |
*/ | |
var Preferences = { | |
fbToken: '1234', |
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' | |
}); | |
var view = Ti.UI.createImageView({ | |
height: 200, | |
backgroundColor:'#f00' | |
}) | |
win.add(view); |
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' | |
}); | |
var view = Ti.UI.createImageView({ | |
height: 200, | |
backgroundColor:'#f00' | |
}) | |
win.add(view); |
NewerOlder