Similar to Activity not extended below the cutout in landscape, but the answer there is limiting.
In landscape, the camera cutout is on the left. I used
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
to stretch the background color below it:
I would like to actually render some elements (like the title panel) below the cutout area. Is this possible, without entering full screen?
First you need set
window_flags
, we can useWindowCompat
fromandroidx.appcompat
.Add this in your activity
onCreate
. This asks the system to lay out your activity edge to edge.Then you need to add necessary padding to your content that should not be blocked. For example, here I have added padding to my
AppBar
. This is achieved by setting an inset listener callback on any view once.You mostly only want to deal with
systemBars
as cutouts usually change the systemBar's size. Unless you are targeting a specific device cutout.