title: Fullscreen App With DisplayCutout
body: <p>How do you make an app with an actual fullscreen capabilities, that has the layout to be rendered underneath the notch?</p>
  
  <p>Here's what I want:</p>
  
  <p><a href="https://i.stack.imgur.com/yxzNk.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/yxzNk.jpg" alt="Google Photos"></a></p>
  
  <p>Here's the code of what I've tried:</p>
  
  <pre><code>class MainActivity : Activity() {
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
  
          if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.P) {
  //            window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
  
              val attrib = window.attributes
              attrib.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
  
              layout_main.setOnApplyWindowInsetsListener { _, windowInsets -&gt;
                  val inset = windowInsets.displayCutout
                  Log.d("Tag", "Inset: $inset")
                  windowInsets
              }
          }
      }
  }
  </code></pre>
  
  <p>The layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/layout_main"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#3000FFFF"
      android:fitsSystemWindows="true"&gt;
  
      &lt;View
          android:layout_width="50dp"
          android:layout_height="50dp"
          android:background="#FFFF0000"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" /&gt;
  
      &lt;View
          android:layout_width="50dp"
          android:layout_height="50dp"
          android:background="#FF00FF00"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintTop_toTopOf="parent" /&gt;
  
      &lt;View
          android:layout_width="50dp"
          android:layout_height="50dp"
          android:background="#FF0000FF"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintStart_toStartOf="parent" /&gt;
  
      &lt;View
          android:layout_width="50dp"
          android:layout_height="50dp"
          android:background="#FFFF00"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toEndOf="parent" /&gt;
  
      &lt;TextView
          android:layout_width="0dp"
          android:layout_height="0dp"
          android:gravity="center"
          android:text="Hello World!"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" /&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>The style:</p>
  
  <pre><code>&lt;style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"&gt;
      &lt;item name="colorPrimary"&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name="colorPrimaryDark"&gt;@color/colorPrimaryDark&lt;/item&gt;
      &lt;item name="colorAccent"&gt;@color/colorAccent&lt;/item&gt;
  
      &lt;item name="android:windowNoTitle"&gt;true&lt;/item&gt;
      &lt;item name="android:windowActionBar"&gt;false&lt;/item&gt;
      &lt;item name="android:windowFullscreen"&gt;true&lt;/item&gt;
      &lt;item name="android:windowContentOverlay"&gt;@null&lt;/item&gt;
  
      &lt;item name="android:windowTranslucentStatus"&gt;true&lt;/item&gt;
      &lt;item name="android:windowTranslucentNavigation"&gt;true&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>Here's the Android Manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.app.testandroidp"&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:roundIcon="@mipmap/ic_launcher_round"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
  
          &lt;activity
              android:name="com.app.testandroidp.MainActivity"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Here's the result that I've gotten so far:</p>
  
  <p><a href="https://i.stack.imgur.com/Vhhhk.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Vhhhk.jpg" alt="enter image description here"></a></p>
  
  <p>I've tried setting different themes, setting the fullscreen flag in XML / Kotlin, setting the resizable activity in manifest, but the activity just won't get rendered under the notch.</p>
  
  <p>For reference, this is the project's source code: <a href="https://gitlab.com/alvin.rusli/AndroidPTest" rel="noreferrer">https://gitlab.com/alvin.rusli/AndroidPTest</a></p>