See (sorry SOF won't let me upload an image)
This is what I am trying to achieve. I have a map view and I want the status bar to be transparent to make maps look like it's under the text of status bar (like in uber app). I use
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
/*,WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS*/);
this tag to do that. But the problem is I also have 4 buttons (like bottom nav bar) in the bottom. When I use that tag those buttons get behind the navigation bar (software keys).
I think if I use 2 different layouts it'll work, like one layout for phones with NavBar, and one for phones with hardware keys. But I Just don't know how. I've tried using this function but either it doesn't work or I am implementing it wrong please Help.
public boolean hasNavBar (Resources resources) {
int id = resources.getIdentifier("config_showNavigationBar", "bool", "android");
return f= id > 0 && resources.getBoolean(id);
}
And then using if(f==true), else to change layout and java files but this always gives false.