Javier
01/08/2022, 2:09 PMOnPointerEvent
common API for Desktop and Android?PointerEventType
is common but the modifier is missing...
.pointerInput(
key1 = Unit,
block = {
detectTapGestures(
onTap = { offset ->
...
}
)
}
),
detectTapGestures
modifier should be greatAdam Powell
01/08/2022, 5:11 PM.clickable
? We didn't find much there to counterbalance people using a tap-input-only modifier when clickable
would be more appropriate, and then creating a poor experience with regard to missing visual feedback or keyboard/focus behaviorkey1 =
and block =
params in calls like that leads to less readable code than the intended form:
.pointerInput(Unit) {
detectTapGestures(...
Javier
01/08/2022, 7:24 PMclickable
allows getting the offset click position?block
to be renamed to something more descriptivedetectTapGestures
works if I am pressing a Button
inside a Box
, and the detectTapGestures
is applied to the Box
itself.
Basically I need to know where the user is clicking to do an animation based on that, independently in which children the user clicks.Button
is not detected by the parent boxAdam Powell
01/08/2022, 11:07 PMawaitPointerInputScope
in pointerInput
. You'll see all events before children do in the initial pass.Javier
01/09/2022, 12:27 AMawaitPointerInputScope.currentEvent.changes
should be changing the list after every click? It is always empty and the type is Unknown
.Adam Powell
01/09/2022, 2:51 AMawaitPointerEvent
function to await the next event. Loop as desired.Javier
01/09/2022, 1:09 PMwhile(true)
?Adam Powell
01/09/2022, 4:08 PMJavier
01/09/2022, 7:23 PMawaitPointerEvent
in the parent composable, but I can't still detect if the child Button
is pressed and where was it pressed, I am forced to set that modifier to the Button
too? I tried all possible passes, no luck.
Initial: Down the tree from ancestor to descendant.
Main: Up the tree from descendant to ancestor.
Final: Down the tree from ancestor to descendant.