Home > database >  How to handle cutout area by compose?
How to handle cutout area by compose?

Time:04-22

I'm a Android development beginner . How to handle cutout area by compose? As far as I know... WindowManager doesn't provide information about cutout area. and LayoutInDisplayCutoutMode can be set in xml file. I ask for your advice, please.

CodePudding user response:

In Compose 1.2.* (currently in alpha) you can get it like this:

// get value:
WindowInsets.displayCutout

// apply padding modifier:
Modifier.displayCutoutPadding() 

In earlier versions you can use Accompanist Insets library:

// get value:
LocalWindowInsets.current.displayCutout

// apply padding modifier:
Modifier.cutoutPadding()
  • Related