How I can calculate height of software buttons (like in galaxy nexus or razr motorola hd) ?
Personally, I suppose that DisplayMetrics.heightPixels
attribute is height of all screen without software buttons height and with height of status bar.
Hence, software buttons height = specification height - DisplayMetrics.heightPixels.
Exemple for nexus 7:
75(soft button height) = 1280(spec height) - 1205(DisplayMetrics.heightPixels)
Im right ? please confirm.
My assumption is right.
to generalize question and prove it, here manual measurement what I have done on telephone and tablet from screenshots :
portrait: 48 dp
1280 - 1184 == 96 px == 48dp xhdpi
landscape: 42 dp
1280 - 1196 == 84 px == 42dp xhdpi
( attention!: in landscape, this is not height but width of software button placed on right side of screen)
portrait: 56dp
...
landscape: 48dp
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With