How to programmatically determine the height of the bottom panel with touch buttons (see. Figure)

The fact is that the panel on the emulator overlaps my view. Found how to programmatically determine the presence of this panel, but with a programmatic definition of its height problems :)

if(!ViewConfiguration.get((Context)this).hasPermanentMenuKey()) { // панель присутствует } else { // панель отсутствует } 

What is the name of this panel? How to determine its height?

enter image description here

  • The root layout of yours should be match_parent and this will solve your problem in a simple and clear way - pavlofff 10:49 pm
  • Parent view and all parents grandparents are tall match_parent - Roman Novoselov 2:26 pm

2 answers 2

  if (Build.VERSION.SDK_INT >= 17) { Point size = new Point(); display.getRealSize(size); Log.d("full size", size.x + " x " + size.y); } else { int x = displayM.widthPixels; int y = displayM.heightPixels; Log.d("full size", x + " x " + y); } if (Build.VERSION.SDK_INT >= 13) { Point size = new Point(); display.getSize(size); Log.d("app size", size.x + " x " + size.y); } 

Up to 13 API phones do not have such buttons, then you can find the difference between the full size and size of the application. But can it just take advantage of getting the size of the application?

  • It seems to me there is a more trivial solution (like getting the statusbar height). thanks for the crutch anyway)) - Roman Novoselov
  • @RomanNovoselov and why do you need to know the size of the buttons? Maybe some wrap_content / margin_bot is enough? - pavel
  • By the way, the application falls under the panel, so that the full size and size of the application will be equal turns out - Roman Novoselov
  • need the height of this panel to just make a marginBottom - Roman Novoselov 7:42 pm

This panel is called the navigation bar. Its height is 48dp.