Skip to content

Instantly share code, notes, and snippets.

View kellymredd's full-sized avatar

Kelly Redd kellymredd

View GitHub Profile
@kellymredd
kellymredd / app.js
Created August 26, 2011 14:49
remove windows
Ti.UI.setBackgroundColor('#252525');
var device = Ti.Platform.osname;
var ng = {};
// start data
(function() {
ng.data = {};
ng.data.device = Ti.Platform.osname;
ng.data.current_window = null;
ng.data.globalZ = 1;
@kellymredd
kellymredd / app.js
Created August 25, 2011 21:53
can't remove all windows with for loop
// data starts @ line 10
// functions starts @line 47
// ui starts @ line 210
Ti.UI.setBackgroundColor('#252525');
var device = Ti.Platform.osname;
var ng = {};
// start data
function handle_attachments() {
// make sure we have new args before firing
// prevents handling of the same file every time the app opens, resumes, etc
args = Ti.App.getArguments();
var file = args.url;
var source = args.source;
// make sure we have something to work with
if(!file) {
return false;
@kellymredd
kellymredd / filetypes
Created July 17, 2011 16:26
specify file types with your app
/*
This goes in your Info.plist
it's been a while since I added this functionality so I'm not sure what was added and what was already there, you may already have some pieces of the code.
When you tap and hold a mail attachment your app will show up in the list of associated apps and switch to your app when selected.
*/
<key>CFBundleURLTypes</key>
<array>
<dict>
@kellymredd
kellymredd / window factory
Created July 15, 2011 13:42
create multiple windows from reusable function
var ns = {};
(function(){
ns.ui = {};
ns.ui.createNewWindow = function(url){
return Ti.UI.createWindow({url:url});
}
ns.ui.createBaseWindow = function(_args) {
function animReset(line)
{
play_sound = true;
animated = false;
startingLine = 0;
for(a=0;a<=line;a++)
{
if(page1.children[0].children[a].animating)
{
// Create all animations
bookSlideOut = false;
infoSlideOut = false;
// home up/down
var homeUp = Titanium.UI.createAnimation();
homeUp.bottom = 239;
homeUp.duration = 800;
var homeDown = Titanium.UI.createAnimation();