I have AppcompatActivity (appcompat-v7:25.3.1) which is in full screen mode using the below code. But the problem is that when in full screen mode and navigationview is displayed it shows these black overlay bar on top and bottom of it in Android 6.0, equal to the sizes of status bar and navigation bar. Navigation view after applying the below mentioned flags (Can't embed images for now :( )
private void hideAndroidNavigation() {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
In Android 4.4 however the black overlay simply turns to white as you can see in this image.
I was able to remove the overlay for the status bar using following code:
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
But I have no luck for the removal of the navigation bar overlay. I tried this solution https://stackoverflow.com/a/38008965/4428159, suggesting to remove View.SYSTEM_UI_FLAG_LAYOUT_STABLE but still the output was same
Is there any other way to remove these overlays or a solution specific to appcompat libraries?