Android 11 provides several APIs to support waterfall displays, displays that wrap around the edge of the device. These displays are treated as a variant of displays with display cutout, which is an API for the top notch, camera cutout, or any other cutout.
The existing DisplayCutout.getSafeInset…() methods now return the safe inset to avoid waterfall areas as well as cutouts. To render your app content in the waterfall area, do the following:
- Call DisplayCutout.getWaterfallInsets() to get the exact dimensions of the waterfall inset.
- Set the window layout attribute layoutInDisplayCutoutMode to LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS to allow the window to extend into the cutout and waterfall areas on all edges of the screen. You must make sure that no essential content is in the cutout or waterfall areas.
- Check if it is interesting to use this API to render app content in the waterfall area