This file contains 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
Titanium.UI.setBackgroundColor('#000'); | |
// Create a window | |
var win = Titanium.UI.createWindow({ | |
title:'Web Test', | |
backgroundColor:'#fff' | |
}); | |
// and now a webView | |
var webview1 = Titanium.UI.createWebView({url:'somePage.html'}); |
This file contains 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 updatePeriod = 5 * 60 * 1000; //mins * seconds * 1000 | |
var locationUpdateEnabled = false; | |
// This gets fired when the webView has loaded. | |
// Rather than using the generic event of the webview | |
// - it's more reliable to create your own and have the page itself trigger when it's ready | |
// - This allows your code to initialise things properly before asking for update | |
Ti.App..addEventListener('pageReadyForUpdates', function(e) { | |
// This will only get fired once and when the page itself is ready to start receiving update |
This file contains 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
// Create the xhr object | |
var xhr = Titanium.Network.createHTTPClient(); | |
// Set the static properties on the xhr object | |
xhr.setTimeout(20000); | |
// Helper for updating the interface | |
function networkUpdateSuccess() { | |
alert('Success Uploaded',Ti.App.globalImage); |
This file contains 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 developer creates a module | |
They wish to create a single module but have enhanced API functionality for 2.1+ because they depend on some API features only available on that platform. The API they are using also may have changed between platform versions (think Android contacts). | |
For users of the 1.6 module - they will have reduced functionality but broader reach. | |
Option (1) | |
They release 2 differently named modules and the module consumer has to download/buy both | |
Option (2) | |
Use a folder structure for modules that differentiate based on platform. |
This file contains 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 = Titanium.UI.currentWindow; | |
var xhr; | |
Ti.App.globalImage = null; | |
function alert(title,message){ | |
var alertDialog = Titanium.UI.createAlertDialog({ | |
title: title, | |
message: message, | |
buttonNames: ['OK'] |
This file contains 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
/** | |
* Menu | |
**/ | |
/** | |
* initMenu(); - Clears & inits the menu object | |
* addMenuItem(MenuItem); - Which we pass a menuItem which is then added to an array of menu items | |
* buildMenu(); - which sets the menu (use from the calling window) | |
*/ |
This file contains 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
/** | |
* Appcelerator Titanium Mobile | |
* Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved. | |
* Licensed under the terms of the Apache Public License | |
* Please see the LICENSE included with this distribution for details. | |
*/ | |
package ti.modules.titanium.ui.widget; | |
public class TiUIText extends TiUIView | |
implements TextWatcher, OnEditorActionListener, OnFocusChangeListener |
This file contains 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
/** | |
* You don't need to specify this directly, a module definition class is generated for you as part of the build process for your module | |
* | |
*/ | |
@Ti.module( | |
name = "UrbanAirships", | |
version = @version(buildVersion=0, minorVersion=0, majorVersion=1), | |
dependsUponTitanium = @version(minorVersion=3, majorVersion=1) | |
) |
This file contains 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
<path>1.3.3/titanium.py create | |
--platform=android | |
--type=module | |
--dir=<top most folder for the project> | |
--name=<projectName> | |
--android=<android SDK path > | |
--id=<the project class path ie: org.appcelerator.widget> |
This file contains 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
{% extends "APIMeteringBundle::layout" %} | |
{% block title %}Index{% endblock %} | |
{% block content %} | |
{% import "APIMeteringBundle::macros" as forms %} | |
{% autoescape off %} | |
{{ form.renderAs('Renderer\\TablelessRenderer') }} | |
{{ form.render }} | |
{{ form.renderFormTag(formURL)}} | |
Client Reference: {{ form.refID.render }} |