Last active
September 2, 2019 14:23
-
-
Save hto/7ed5ef629bd8bdf651c73f3680541ad5 to your computer and use it in GitHub Desktop.
React Native Wix Navigation V2 - Android Navigation Buttons Bar Hide - HTC - Nexus - FullScreen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.app; | |
import com.reactnativenavigation.NavigationActivity; | |
import android.content.Intent; | |
import android.content.res.Configuration; | |
import android.os.Bundle; | |
import android.view.View; | |
public class MainActivity extends NavigationActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) | |
{ | |
super.onCreate(savedInstanceState); | |
final int flags = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | |
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | |
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE | |
| View.SYSTEM_UI_FLAG_LOW_PROFILE | |
| View.SYSTEM_UI_FLAG_FULLSCREEN | |
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | |
| View.SYSTEM_UI_FLAG_IMMERSIVE; | |
getWindow().getDecorView().setSystemUiVisibility(flags); | |
final View decorView = getWindow().getDecorView(); | |
decorView | |
.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() | |
{ | |
@Override | |
public void onSystemUiVisibilityChange(int visibility) | |
{ | |
if((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) | |
{ | |
decorView.setSystemUiVisibility(flags); | |
} | |
} | |
}); | |
} | |
@Override | |
public void onWindowFocusChanged(boolean hasFocus) | |
{ | |
super.onWindowFocusChanged(hasFocus); | |
getWindow().getDecorView().setSystemUiVisibility( | |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | |
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | |
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE | |
| View.SYSTEM_UI_FLAG_LOW_PROFILE | |
| View.SYSTEM_UI_FLAG_FULLSCREEN | |
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | |
| View.SYSTEM_UI_FLAG_IMMERSIVE); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Thanks for great help,
I'm wondering how I can do this in just one screen, for example if I want the modal to be fullscreen.
Best regards