문제

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?

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top