Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@amirh
Copy link
Contributor

@amirh amirh commented Dec 26, 2018

Previously the framework could only tell the engine to forward a touch
sequence to an embeded UIView between the time touches has started and
the time touches ended. This couldn't support gesture arena setups where
the gesture is recognized after the touch sequence is complete (e.g a
tap competing with a scroll).

This change makes it so that a touch gesture is only finally rejected by
a platform view when the framework invokes the rejectGesture method.
This allows the framework to resolve a gesture conflict after the touch
sequence was ended.

Will land this after flutter/flutter#25792

fixes flutter/flutter#24076
fixes flutter/flutter#24207

Previously the framework could only tell the engine to forward a touch
sequence to an embeded UIView between the time touches has started and
the time touches ended. This couldn't support gesture arena setups where
the gesture is recognized after the touch sequence is complete (e.g a
tap competing with a scroll).

This change makes it so that a touch gesture is only finally rejected by
a platform view when the framework invokes the `rejectGesture` method.
This allows the framework to resolve a gesture conflict after the touch
sequence was ended.
amirh added a commit to amirh/flutter that referenced this pull request Dec 26, 2018
flutter/engine#7307 changes the engine side of embedded UIView to only
reject gestures when the framework sends a `rejectGesture` message, so
that gesture resolution can done after a touch sequence has ended (see
PR description for flutter/engine#7307 for more details).

This change makes the framework send a `rejectGesture` message to the
engine when a UiKitView rejects a gesture.

I'm planning to land this PR before the engine side change, so right now
it swallows the exception thrown if there is no engine implementation
for `rejectGesture` (which keeps us with the current behavior). After
this change lands I'll land the engine PR, and then clean up the part
that swallows the exception.
Copy link
Contributor

@liyuqian liyuqian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSLGTM.

I'm really unfamiliar with Objective C... Is there a test that fails the old code and passes the new code? That would make my rubber stamp much stronger...

@amirh
Copy link
Contributor Author

amirh commented Dec 26, 2018

I wish we had a test, we don't have the framework for integration tests that are doing gestures on iOS right now 😞 .

There is a "manual" test, if you run the google_maps_flutter example app right now and tap on the marker in the "scrolling map" sample, the tap won't register (as it is a delayed gesture resolution), with this change and flutter/flutter#25792 it works.

@amirh
Copy link
Contributor Author

amirh commented Dec 26, 2018

Going to land with the RSLGTM, TBR @chinmaygarde.

amirh added a commit to flutter/flutter that referenced this pull request Dec 27, 2018
flutter/engine#7307 changes the engine side of embedded UIView to only
reject gestures when the framework sends a `rejectGesture` message, so
that gesture resolution can done after a touch sequence has ended (see
PR description for flutter/engine#7307 for more details).

This change makes the framework send a `rejectGesture` message to the
engine when a UiKitView rejects a gesture.

I'm planning to land this PR before the engine side change, so right now
it swallows the exception thrown if there is no engine implementation
for `rejectGesture` (which keeps us with the current behavior). After
this change lands I'll land the engine PR, and then clean up the part
that swallows the exception.
@amirh amirh merged commit cc9c670 into flutter:master Dec 27, 2018
@amirh amirh deleted the reject_gesture branch December 27, 2018 06:11
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 27, 2018
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 27, 2018
amirh added a commit to amirh/engine that referenced this pull request Dec 27, 2018
amirh added a commit that referenced this pull request Dec 27, 2018
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 27, 2018
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 27, 2018
amirh added a commit to amirh/engine that referenced this pull request Dec 27, 2018
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 27, 2018
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 27, 2018
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 27, 2018
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 28, 2018
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 28, 2018
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 28, 2018
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 28, 2018
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gesture recognizer error when using UiKitView Embedded UIViews reject gestures after the sequence has ended

3 participants