Created
June 11, 2019 18:49
-
-
Save mykltronn/ddb20ff7127cbd6d517407b85c42631d to your computer and use it in GitHub Desktop.
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
public class ImmersiveMode extends ReactContextBaseJavaModule { | |
. . . | |
// Previously added stuff | |
// our method takes one argument, systemUIFlags. | |
// It ends up being an integer, which is pretty neat-- more on that later. | |
private void setSystemUIFlags(int visibility) { | |
// here we get ourCurrentActivity | |
// from it, we grab the window | |
// and from that we grab the decorView for our current activity | |
View decorView = getCurrentActivity().getWindow().getDecorView(); | |
// think of the decorView as the eldest ancestor of the UI class familly tree. | |
// it contains not only your views, but all current system views | |
// eg system alerts and *navigation elements* | |
// it contains a method for manipulating some of those system views | |
decorView.setSystemUiVisibility(visibility); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment