This app is a collection of various UI design patterns written as JavaScript modules for Titanium Mobile. This will show you how to develop and implement factory components for event driven mobile applications.
THIS IS FOR iOS ONLY. Sorry. Android support is coming next.
This is a basic implementation of an a heads up display, or alert view, that gracefully displays loading indicator and message.
This module is designed to "lock down" an app by invoking a passcode screen and prompting a user to input a 4 digit code. This is loosely based on Apple's internal passcode feature in iOS.
More modules to come...
To access these modules from JavaScript, you would extend your app namespace in app.js and import the module using the global require() method:
// Extend your existing app namespace for your modules to exist
MyApp.mod = {};
MyApp.mod.hud = require('modules/hud');
MyApp.mod.passcode = require('modules/passcode.mod');
var HUD = MyApp.mod.hud.init(MyApp.ui.win); // pass in the window to attach the HUD
HUD.show('YOUR MESSAGE');
setTimeout(function(){
HUD.hide();
},2000);
init(win); // window object (required)
show(message); // message (optional)
hide();
- Initialize the module using the
init()
method and pass in a 4 digit number to validate against. - Show a HUD by calling
show()
, passing an optional message to the component. - You can remove a HUD by calling the
hide()
method.
Note: Replace 'MyApp' with your own app namespace.
var PIN = MyApp.mod.passcode.init({code:1234,barColor:'#0079C1'});
PIN.open({
success:function(){
// do something
},error:function(){
// do something
}});
init(code,barColor); // 4 digit number (required), barColor (optional)
open(success,error); // success callback (optional), error callback (optional)
close(); // force close a passcode window
- Initialize the module using the
init()
method and pass in a 4 digit number to validate against. - Show a passcode window by calling
open()
. You can optionally pass in two callbacks: "success" and "error" that will be executed on each event. This is where you can choose to allow a user to continue or not.
Note: Replace 'MyApp' with your own app namespace.
Terry Martin
This content is released under the MIT License. http://www.opensource.org/licenses/mit-license.php
Enjoy! Stay tuned for more modules being added to this project.