[Android] Remove workaround for touch events allowing to change state too soon #3793
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Supersedes #2283
On Android,
onTouchesDownwas delayed to be dispatched afteronBeginso that the handlers had the time to initialize themselves (which happens inonHandle) so that the non-touch events would have correct data.The old approach was saving the event, which triggered the touch event, and using that event to initialize the handler during imperative state change. The issues with that approach were:
The new approach is to add an option to force gestures to initialize regardless of the state they are in. This way, when the state is updated and the current state of the handler is
UNDETERMINED, the flag is set on the handler, and when it starts handling the event, it will first initialize itself.Test plan
Tested on the following snippet, with affected gestures