When I put logs in forEachGesture, it seems like the pointer id is set to 2 for all 4 events, and the event.changes size is always 1, instead of (1, 2, 2, 1) like when I do the same gesture manually. Is there something I’m doing wrong in my code?
a
Andrew Neal
01/06/2023, 4:04 PM
Have you tried using
awaitEachGesture
instead of
forEachGesture
?
l
Landry Norris
01/06/2023, 4:05 PM
I currently have the following structure:
Copy code
forEachGesture {
awaitPointerEventScope {
do {
val event: PointerEvent = awaitPointerEvent()
Landry Norris
01/06/2023, 4:08 PM
I’m not on the 1.4.0 pre-releases, so I can’t use awaitEachGesture yet.
Landry Norris
01/06/2023, 4:09 PM
After some fiddling, I found that point1 was actually pressing a view I forgot was over the one I’m testing. It makes sense I only got one touch event in that case, but I’m not sure why the id was 2 instead of 1 (the finger that touched the correct view). I tried changing the id of both fingers, but when one touched another view, the received id was always 2.