Skip to main content
added 377 characters in body
Source Link
hmac
  • 343
  • 4
  • 9

The accepted answer (@azizbekian) wasn't enough for me, I also needed to apply this to the dialog (onCreateDialog):

window?.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)

or this if you want under status bar but above nav bar:

window.decorView.systemUiVisibility =
window.decorView.systemUiVisibility or
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
 
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
window.statusBarColor = Color.TRANSPARENT

The accepted answer (@azizbekian) wasn't enough for me, I also needed to apply this to the dialog (onCreateDialog):

window?.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)

The accepted answer (@azizbekian) wasn't enough for me, I also needed to apply this to the dialog (onCreateDialog):

window?.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)

or this if you want under status bar but above nav bar:

window.decorView.systemUiVisibility =
window.decorView.systemUiVisibility or
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
 
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
window.statusBarColor = Color.TRANSPARENT
Source Link
hmac
  • 343
  • 4
  • 9

The accepted answer (@azizbekian) wasn't enough for me, I also needed to apply this to the dialog (onCreateDialog):

window?.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)