Skip to content

Instantly share code, notes, and snippets.

@sumitsahoo
Created June 24, 2020 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sumitsahoo/61c8f2941b0e26f6c01e6f7304328243 to your computer and use it in GitHub Desktop.
Save sumitsahoo/61c8f2941b0e26f6c01e6f7304328243 to your computer and use it in GitHub Desktop.
Make status bar transparent
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