Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix onBegin and onTouchesDown events ordering on Android #2283

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

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