Stylianos Gakis
05/15/2024, 9:21 PMModifier.systemGestureExclusion
work even if my composable doesn't touch the edge of the screen?
I got a composable which is rendered 8.dp away from the edge of the screen.
I then pass
.systemGestureExclusion { coordinates ->
val boundsInRoot = coordinates.boundsInRoot()
Rect(
boundsInRoot.left,
<http://boundsInRoot.top|boundsInRoot.top>,
boundsInRoot.right,
boundsInRoot.bottom,
).inflate(with(density) { 16.dp.toPx() })
}
With the hope that my "exclusion" Rect will then properly touch the edges.
My composable itself is like 64.dp high, so at most I would be excluding <100.dp, which seems to be within the limit of 200.dp that we can exclude
Anyone who has tried to do the same?Stylianos Gakis
05/16/2024, 10:35 AM.systemGestureExclusion()
to it, and then added the padding so that it visually still looks the same.
This works well now, so not if this API does in fact work if the composable does not already touch the edges 🤷 Maybe I did something wrong, but I am not sure