Javier
01/08/2022, 2:09 PMOnPointerEvent
common API for Desktop and Android?Javier
01/08/2022, 2:10 PMPointerEventType
is common but the modifier is missingJavier
01/08/2022, 2:19 PM...
.pointerInput(
key1 = Unit,
block = {
detectTapGestures(
onTap = { offset ->
...
}
)
}
),
Javier
01/08/2022, 2:19 PMdetectTapGestures
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 behaviorAdam Powell
01/08/2022, 5:12 PMkey1 =
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?Javier
01/08/2022, 7:26 PMblock
to be renamed to something more descriptiveJavier
01/08/2022, 7:30 PMdetectTapGestures
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.Javier
01/08/2022, 7:48 PMButton
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 PMAdam 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.