Question

I'm transitioning my app over to KitKat devices (translucent navigation bar/status bar) but I'm stuck on a tiny problem. I'm able to get the default height of the navigation bar by using the following code:

int resourceId = getResources().getIdentifier("navigation_bar_height", 
                                              "dimen", 
                                              "android");
int navigationBarHeight = getResources().getDimensionPixelSize(resourceId);

However, if the user has GravityBox with Pie Controls (or another ROM that hides/resizes the navigation bar), I still get the same default height of the original navigation bar. Is there any way to get the height of the navigation bar dynamically? Ie, I'd like to be able to get the current height of the navigation bar (especially if it's hidden/resized), not just the default navigation bar size. Thanks!

As an alternative option, is there any way to detect if/when the navigation bar has been hidden?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top