Created
May 2, 2017 08:51
-
-
Save hitesh-dhamshaniya/026769e443c7b4452125d921eaf7fe48 to your computer and use it in GitHub Desktop.
FullScreenAndroid - Transparent status bar
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
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | |
Window w = getWindow(); // in Activity's onCreate() for instance | |
//use this to make transparent both status and navigationbar, add 24dp marginTop to toolbar in xml | |
w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); | |
// use this to make transparent status bar, No need to add 24dp marginTop to toolbar. | |
/*w.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);*/ | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | |
w.setExitTransition(null); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment