Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ti.detect

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ti.detect

A simple Titanium library to detect things

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by20%
Maintainers
1
Weekly downloads
 
Created
Source

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

}

Keywords

FAQs

Package last updated on 27 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc