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
/** | |
* We're going to create an infinite loading table view. Whenever you get close to the bottom, we'll load more rows. | |
*/ | |
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
var isAndroid = Ti.Platform.osname === 'android'; | |
/** | |
* Create our UI elements. | |
*/ | |
var table = Ti.UI.createTableView({ top: 0, right: 0, bottom: 0, left: 0 }); |
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 = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
/** | |
* Adds "swipe" event support to Android, and adds swipe up and down to iOS. | |
* @param view The view that should be made swipeable. | |
* @param allowVertical Whether or not vertical swipes (up and down) are allowed; default is false. | |
* @param tolerance How much further you need to go in a particular direction before swipe is fired; default is 2. | |
*/ | |
function makeSwipeable(view, allowVertical, tolerance) { | |
tolerance = tolerance || 2; |
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
/* Kosso : March 12th 2011 | |
This the only way I managed to do this without the app crashing on resume. | |
Done slightly differently to the KS example, since they unregister the service and | |
do not use a setInterval timer. | |
*/ | |
//############ in app.js : | |
// test for iOS 4+ |
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 container = Ti.UI.createView({backgroundColor: "white", layout: "vertical"}); | |
var layout = [ | |
{ | |
title: "Parent 1", | |
isparent: true, | |
opened: false, | |
sub: [ | |
{ |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>h5</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js"></script> | |
<script src="exif.js"></script> | |
<style> | |
#holder { border: 1px dashed #ccc; width: 100px; height: 100px; margin: 20px auto;} | |
#holder.hover { border: 1px dashed #333; } | |
#result .property { width: 100px; } |
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 os = require('os').os; | |
//branch logic based on platform - saves you an if statement | |
os(function() { | |
alert('do this on android'); | |
}, function() { | |
alert('do this on iOS'); | |
}); | |
var platformSpecificValue = os('android string','ios string'); |
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 os = require('os').os; | |
//branch logic based on platform - saves you an if statement | |
os(function() { | |
alert('do this on android'); | |
}, function() { | |
alert('do this on iOS'); | |
}); | |
var platformSpecificValue = os('android string','ios string'); |
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 tracer = {}; | |
(function() { | |
tracer.levels = {}; | |
tracer.levels.DEBUG = 1; | |
tracer.levels.INFO = 2; | |
tracer.levels.WARN = 3; | |
tracer.levels.ERROR = 4; | |
tracer.levels.OFF = 5; | |
tracer.allTracers = []; |
OlderNewer