Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

software buttons height

Tags:

android

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.

like image 779
Sergey Vakulenko Avatar asked Jan 09 '13 10:01

Sergey Vakulenko


1 Answers

My assumption is right.

to generalize question and prove it, here manual measurement what I have done on telephone and tablet from screenshots :

SOFTWARE BUTTONS HEIGHT

  • samsung galaxy nexus

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)

  • on nexus 7

portrait: 56dp
...

landscape: 48dp
...

like image 86
Sergey Vakulenko Avatar answered Oct 13 '22 11:10

Sergey Vakulenko