Tolriq
12/03/2021, 8:31 PMGeorge Mount
12/03/2021, 8:49 PMzIndex
only works wthin the parent and there isn't any other way to move a child outside of its parent's zIndex
. You would have to lift the child out of the parent or lift the entire parent.
While I don't think clickable
offers the ability to handle overlapping views, you can do it with the pointer system. You can do something like this to handle it similar to `onInterceptTouchEvent`:
Modifier.pointerInput(onClick) {
forEachGesture {
awaitPointerEventScope {
var down: PointerEvent
do {
down = awaitPointerEvent(PointerEventPass.Initial)
} while (!down.all { it.changedToDown() } )
down.consumeDownChange()
do {
val up = awaitPointerEvent(PointerEventPass.Initial)
} while (!up.all { it.changedToUp() })
onClick()
}
}
}
You can look at some of the internal functions for some robust handling. For example awaitFirstDownOnPass
.PointerEventPass.Initial
Tolriq
12/03/2021, 9:24 PMGeorge Mount
12/03/2021, 9:30 PMTolriq
12/03/2021, 9:38 PMDaniele Segato
12/06/2022, 11:38 PM