Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbankier/hasmenu
Android native Titanium module to determine the device has a hardware menu button
https://github.com/dbankier/hasmenu
Last synced: about 2 months ago
JSON representation
Android native Titanium module to determine the device has a hardware menu button
- Host: GitHub
- URL: https://github.com/dbankier/hasmenu
- Owner: dbankier
- License: other
- Created: 2013-11-01T00:15:40.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-11-01T02:17:57.000Z (about 11 years ago)
- Last Synced: 2024-04-08T16:42:31.786Z (9 months ago)
- Language: Python
- Size: 207 KB
- Stars: 8
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HasMenu
This is simple android native titanium module that can be used to determine whether
an Android device has a hardware menu button or not.## Why do you care?
If a device like some newer Android devices has virtual buttons
then `Ti.Platform.displayCaps.screenHeight` or `screenWidth` does
not include the on screen system bar. Also when changing from portrait to landscape the height
and width are recalculated excluding the system bar which is repositioned.
(i.e. height landscape != width portrait)## More Info
The module is really very simple and is only really one line of code. (Is it really worth a repo?)
Also it is built and needs API 14.# How to
Install the modules like you install any module. Then you can do the following:
```
if (require('yy.hasmenu').hasMenu) {
Ti.API.debug("Has a hardware button");
} else {
Ti.API.debug("Uses a system bar, should probably add 48dp");
}
```Licence: MIT