title: Android API 23 white status bar hides the view content
body: <p>I want to change status bar color from transparent to white. It works on all APIs from 21 to 28 but not on API 23 :-)</p>
  
  <p>I tried many different combinations of <code>systemUiVisibility</code> flags but the result is:</p>
  
  <ul>
  <li>either white Status bar with dark text and no layout content, </li>
  <li>or visible layout content and white status bar with white text (invisible status bar). </li>
  </ul>
  
  <p>I was not able to achieve both visible white status bar and visible XML layout of my app. </p>
  
  <pre><code>fun Activity.setStatusBarColorLight(drawer: DrawerLayout? = null) {
  if (Build.VERSION.SDK_INT &gt; Build.VERSION_CODES.LOLLIPOP_MR1)
      this.window?.apply {
          decorView.systemUiVisibility = 0
          clearFlags(FLAG_TRANSLUCENT_NAVIGATION)
          clearFlags(FLAG_TRANSLUCENT_STATUS)
          addFlags(FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS or FLAG_FORCE_NOT_FULLSCREEN)
          val color = AttributeUtils.obtainStyledAttributeColor(context, R.attr.colorPrimary)
          statusBarColor = color
          drawer?.setStatusBarBackgroundColor(color)
          if (UtilsKt.isColorLight(statusBarColor) &amp;&amp; Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {   
              decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR           
          }
      }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>fun Activity.setTransparentStatusBar(colorId: Int = android.R.color.transparent, drawer: DrawerLayout? = null) {
  if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {
      this.window?.run {
          val color = context.resources.getColor(colorId, theme)
          decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
          addFlags(FLAG_TRANSLUCENT_STATUS)
          statusBarColor = color
          drawer?.setStatusBarBackgroundColor(color)
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Unfortunately, it seems there are no good tutorials on how to use these <code>systemUiVisibility</code> and window flags and their combinations :-(</p>