1.0.0 • Published 10 years ago

falkolab-version v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

Android version helper commonjs module for Titanium SDK

Available on gitTio

Installation

With npm for Node.js and io.js you can easily install it with

$ npm install --save falkolab-version

With gitTio for Titanium SDK you can easily install it with

$ gittio install falkolab-version

To 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" />
...