[TIMOB-25644] Check for physical/software buttons
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Marian Kucharcik |
Assignee | Unknown |
Created | 2017-12-11T09:29:32.000+0000 |
Updated | 2018-02-28T19:54:59.000+0000 |
Description
Hi guys,
I think many of developers who uses newer phones has to check, if device has physical or software back button, menu button and home button.
If they are software buttons, I have to calculate screen size - height of this buttons.
It will be very nice to have property to check for this in native Titanium without Hyperloop.
I check it like this:
var keyCharacterMap = require('android.view.KeyCharacterMap');
var keyEvent = require('android.view.KeyEvent');
var hasBackButton = keyCharacterMap.deviceHasKey(keyEvent.KEYCODE_BACK);
I tested with Nexus 5X (software buttons, hasBackButton = false) and Samsung Galaxy A5(physical buttons, hasBackButton = true).
Thanks in advance for response
No comments