falkolab-version
v1.0.0
Published
Android version helper commonjs module for Titanium SDK
Maintainers
Readme
Android version helper commonjs module for Titanium SDK
Installation
With npm for Node.js and io.js you can easily install it with
$ npm install --save falkolab-versionWith gitTio for Titanium SDK you can easily install it with
$ gittio install falkolab-versionTo download the module for manual install (e.g. through Appcelerator Studio).
Usage
You can use this module in both Classic or Alloy projects.
Alloy usage
alloy.js
var version = require('com.falkolab.version');
_.extend(Alloy.Globals, version);
In your TSS files:
// API_LEVEL >= 14 (ICE_CREAM_SANDWICH)
"#info[if=Alloy.Globals.isAndroidFrom14]" : {
...
}
// API_LEVEL <= 14 (ICE_CREAM_SANDWICH)
"#info[if=Alloy.Globals.isAndroidUpTo14]" : {
...
}
// API_LEVEL === 14 (ICE_CREAM_SANDWICH)
"#info[if=Alloy.Globals.ICE_CREAM_SANDWICH]" : {
...
}
In view *.xml
<View if="Alloy.Globals.isAndroidUpTo14" />
<View if="Alloy.Globals.ICE_CREAM_SANDWICH" />
...
