Created
June 24, 2020 12:11
-
-
Save sumitsahoo/61c8f2941b0e26f6c01e6f7304328243 to your computer and use it in GitHub Desktop.
Make status bar transparent
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
fun makeStatusbarTransparent(activity: AppCompatActivity) { | |
activity.window.apply { | |
clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) | |
addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) | |
decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | |
statusBarColor = Color.TRANSPARENT | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment