Skip to content

Instantly share code, notes, and snippets.

View rblalock's full-sized avatar
🚀

Rick Blalock rblalock

🚀
View GitHub Profile
@rblalock
rblalock / sample2.json
Created October 26, 2010 17:43
Second json source for titanium layout. this time with a remote method
{
Colors: {
someColor: '#333',
otherColor: '#777'
},
someFunction: function(string) {
alert(string);
}
}
@rblalock
rblalock / sample2.js
Created October 26, 2010 17:44
Titanium sample, this time calling a remote function in the json feed.
var searchbar = Ti.UI.createSearchBar({
showCancel: true,
barColor: '#7CA122'
});
Ajax.xhr('GET', '', 'http://localhost/colors.json', function(data) {
searchbar.barColor = data.Colors.someColor;
win.barColor = data.Colors.otherColor;
data.someFunction(win.title);
@rblalock
rblalock / titanium.js
Created October 30, 2010 04:22
A quick layout I did to see how close I could become to the Windows phone interface... Here's a video of it working: http://www.screencast.com/users/XiDScreencasts/folders/Jing/media/370b66e1-d960-40e6-8aa3-42b9a7e4759d
var win = Ti.UI.currentWindow;
win.hideNavBar();
// The main background image
var wrapper = Ti.UI.createImageView({
url: 'images/building.png',
left: -40
});
win.add(wrapper);
@rblalock
rblalock / Animations.js
Created November 9, 2010 16:46
Example animation methods
Ti.include( 'includes/tiframework.js' );
var $ = TiFramework;
var main_window = $('currentWin');
main_window.focus(function() {
// Create the label
var label = $('label')
// Set some options
var win = $('currentWin');
$.ajax({
timeout: 3000,
type: 'GET',
url: 'http://search.twitter.com/search.json?q=from:appcelerator',
callback: function(data) {
// Create a tableView and append it to current window
var customTableView = $('table').appendTo(win);
(function() {
var options = { string: 'Default String' };
TiFramework.extend('test', function(string) {
if (string == undefined) {
alert(options.string);
} else {
alert(string);
}
});
var tableview = Titanium.UI.createTableView({
data: rows,
top: 10,
left: 10,
right: 10,
borderColor: '#ccc',
layout:'vertical'
});
// set filters
@rblalock
rblalock / rowTransitions.js
Created November 23, 2010 20:19
Simple example of misc transitions
var win = Ti.UI.currentWindow;
var rows = [
{ title: 'Sample Title Here' }
];
var tableview = Ti.UI.createTableView({ data: rows });
win.add(tableview);
tableview.addEventListener('click', function() {
@rblalock
rblalock / WindowTransition.js
Created November 23, 2010 20:34
Simple window transition example
var win = Ti.UI.currentWindow;
var rows = [
{ title: 'Sample Title Here' }
];
var tableview = Ti.UI.createTableView({ data: rows });
win.add(tableview);
tableview.addEventListener('click', function() {
@rblalock
rblalock / ExamplePatternController.js
Created November 25, 2010 02:11
Test pattern for Titanium development
//
// Controller File
//
/** Include the framework **/
Ti.include('includes/tiframework.js');
var $ = TiFramework;
// Pull in a few files
Ti.include('includes/styles.js', 'includes/views.js');