I trying to read the actual cutout details via (p...
# compose
t
I trying to read the actual cutout details via (putting in var to ensure recomposition and everything)
Copy code
LocalView.current.rootWindowInsets.displayCutout?.boundingRectRight
but the returned data is always one step late on rotation. So if the phone is portrait with the cutout at top it will be return Rec(0,0,0,0) at start that is wrong, if I rotate to have the cutout at right it will display the same, then if rotate again to portrait it will show the proper value that should have been displayed when in landscape (and it continues like that on each rotations). Seems the Localview is updated at the wrong time for the cutouts. Is there a way to know when to read the value to have the correct one? (Using a launched effect with a small delay works but that's far from ideal)
So a simple
Copy code
LaunchedEffect(LocalConfiguration.current) { read }
Does work, one single frame too early 😞