I'm trying to hide android nav bars like that :
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void hideNavBarsParent(){
mDecorView = getWindow().getDecorView();
mDecorView.setOnSystemUiVisibilityChangeListener(
new View.OnSystemUiVisibilityChangeListener() {
@Override
public void onSystemUiVisibilityChange(int flags) {
hideNavBars();
}
});
}
I'm calling hideNavBars() there, realisation is -
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void hideNavBars(){
if(UrlWorker.isJelleyBean()) {
mDecorView = getWindow().getDecorView();
int uiOptions = 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_LOW_PROFILE;
mDecorView.setSystemUiVisibility(uiOptions);
But once I click anywhere they apear again, so my question is - So there is no way to hide em in android < Kitkat and without using Immersion Mode?
then i tried something as this
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void hideNavBarsParent(){
mDecorView = getWindow().getDecorView();
mDecorView.setOnSystemUiVisibilityChangeListener
(new View.OnSystemUiVisibilityChangeListener() {
@Override
public void onSystemUiVisibilityChange(int visibility) {
// Note that system bars will only be "visible" if none of the
// LOW_PROFILE, HIDE_NAVIGATION, or FULLSCREEN flags are set.
if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
hideNavBars();
} else {
}
}
}); So they must hide in anyway when they are visible, but...