Android Question Detect whether physical buttons are actually painted on screen

Melghost

Member
Licensed User
Longtime User
Hello.

There are a few devices that don't actually have physical buttons, as well as LG Fino, and some other ones. Instead, they have "Back", "Menu" and "Home" buttons painted on screen, at the bottom.

It seems that those devices return the whole screen height when you ask for 100%y, including the buttons' height, so it makes more difficult to adapt a layout for different devices (sometimes views are covered by those buttons)

Is there a way to detect whether the device's buttons are not physical but painted? Is it possible to know how much screen they take up?

I think views' vertical anchors work fine for those kind of devices, so I think a good solution may be to put all layout views into a panel, and set panel's vertical anchor to BOTH. But I'm not sure as I haven't an LG Fino to test it.

Any idea?

Thank you.
 
Top