Giter VIP home page Giter VIP logo

ti.detect's Introduction

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]": {

}

ti.detect's People

Contributors

nicolomonili avatar topener avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ti.detect's Issues

Detects iPhone XR simulator but not device

We have many users with iPhone XRs and while this module correctly detects an XR using the simulator it doesn't detect actual XR devices. Unfortunately we personally do not have an XR device and cannot debug the issue, so we were hoping the issue could be debugged and fixed here instead. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.