All Projects → Topener → ti.detect

Topener / ti.detect

Licence: MIT license
A simple Titanium library which detects things for you

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ti.detect

ti.moddevguide
Appcelerator Titanium native Module Guide
Stars: ✭ 39 (+160%)
Mutual labels:  titanium-module
ti.imagefactory
The ImageFactory Module for Appcelerator Titanium
Stars: ✭ 68 (+353.33%)
Mutual labels:  titanium-module
titanium-alternate-icons
Leverage the ability to change the app icon in iOS 10.3+
Stars: ✭ 24 (+60%)
Mutual labels:  titanium-module
ti.admob
Use the Google AdMob SDK on iOS and Android with Titanium
Stars: ✭ 51 (+240%)
Mutual labels:  titanium-module
ti.youtube
A small library to get the URL of the desired YouTube video ID to use it natively in Ti.Media.VideoPlayer.
Stars: ✭ 13 (-13.33%)
Mutual labels:  titanium-module
ti.locationservices
Titanium Location Services Module for Android
Stars: ✭ 13 (-13.33%)
Mutual labels:  titanium-module
titanium-apple-sign-in
Use the iOS 13+ Apple Sign In API with Titanium
Stars: ✭ 29 (+93.33%)
Mutual labels:  titanium-module
ti.playservices
Titanium module for Google Play Services
Stars: ✭ 19 (+26.67%)
Mutual labels:  titanium-module
ti.paint
Touch-based painting with the Titanium SDK.
Stars: ✭ 27 (+80%)
Mutual labels:  titanium-module
TiDropboxAPIv2
Titanium Appcelerator Javascript Dropbox API v2
Stars: ✭ 13 (-13.33%)
Mutual labels:  titanium-module
av.imageview
Titanium native ImageView module that extends the default Titanium ImageView with more capabilities and a different caching system.
Stars: ✭ 97 (+546.67%)
Mutual labels:  titanium-module
ti.dfp
Doubleclick for Publishers (DFP) module for Titanium Mobile
Stars: ✭ 22 (+46.67%)
Mutual labels:  titanium-module

ti.detect

A simple titanium library which detects things for you.

Right now it only contains wether or not the current iPhone has a notch.

Want it to detect other things? Raise a ticket or submit a PR!

Installing it

For installing, just install it through npm in the app/lib directory

npm i ti.detect

Including it

Just require the library in alloy.js, nothing else is needed.

require('ti.detect');

Generated CFG / Reference

When you have required the library, CFG will be prefilled for you as follows

{
    "statusbarHeight": 20 // or 44 when device has a notch
    "hasNotch": false // or true
}

How to use it

You can access any property like this:

Alloy.CFG.TiDetect.statusbarHeight

So this is useful if you want to avoid the statusbar, regardless wether or not there is a notch, for example this tss

"#statusBar": {
    top: 0,
    height: Alloy.CFG.TiDetect.statusbarHeight,
    backgroundColor: "#777"
}

Or using it as a condition

"#myView[if=Alloy.CFG.TiDetect.hasNotch]": {

}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].