Skip to content

Conversation

j-piasecki
Copy link
Member

Description

This PR changes the ordering of onBegin and onTouchesDown events on Android. onBegin was invoked first, as some gestures required additional setup when they started tracking the first pointer, which is happening after the touch events are dispatched. The workaround for that was to send onTouchesDown later but it resulted in inconsistent behavior between platforms.
The gesture initialization is now abstracted to the parent class and may be invoked by touch events. The one caveat is that it requires an instance of MotionEvent so one needs to be remembered when dispatching the touch event.

Fixes part of #2263.

Test plan

Tested on the example app and on the code from the issue.

@j-piasecki j-piasecki force-pushed the @jpiasecki/fix-event-order-android-2 branch from 89aea03 to d58e6cc Compare August 10, 2023 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants