Se7eN
06/29/2021, 1:13 PMpointerInput
modifier on Box
and pointerInteropFilter
on its children. However, the pointerInteropFilter
modifiers on the children do not receive events because of the pointerInput
on the parent. When I remove the parent pointerInput
, the pointerInteropFilter
modifiers on children work fine. I'm creating a draggable, rotatable, and resizable composable with controls at the corner (see image). How can I fix this? Code in threadSe7eN
06/29/2021, 1:14 PMBox(
modifier = Modifier
...
.pointerInput(...)
...
) {
content()
Control(
modifier = Modifier
.align(Alignment.TopStart)
.offset(...)
.pointerInteropFilter(...),
...
)
Control(
modifier = Modifier
.align(Alignment.TopEnd)
.offset(...)
.pointerInteropFilter(...),
...
)
...
}
Adam Powell
06/29/2021, 2:15 PMpointerInteropFilter
at all as opposed to pointerInput
?Se7eN
06/29/2021, 2:20 PMSe7eN
06/29/2021, 5:54 PMRequestDisallowInterceptTouchEvent
and now it works but only when the pointer is inside the parent (inside the border). Hopefully this is how the RequestDisallowInterceptTouchEvent
is used?
val requestDisallowInterceptTouchEvent = remember { RequestDisallowInterceptTouchEvent() }
pointerInteropFilter(
requestDisallowInterceptTouchEvent = requestDisallowInterceptTouchEvent
) { e ->
requestDisallowInterceptTouchEvent.invoke(true)
...
true
}
Se7eN
07/01/2021, 12:55 PMpointerInput
does the same (only detects events inside the parent)