Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Catch dismissable while it's animating. #1024

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

Merged
merged 1 commit into from
Dec 26, 2015
Merged

Conversation

Hixie
Copy link
Contributor

@Hixie Hixie commented Dec 25, 2015

Fixes #173.

@Hixie
Copy link
Contributor Author

Hixie commented Dec 25, 2015

This doesn't work as well as it should, because the vertical drag gesture and the horizontal drag gesture fight over who should own the pointer so if you put your finger down, it keeps animating. I'm not really sure how to handle that... either the horizontal gesture should always win when you tap an animating dismissable (and you can't drag vertically at that time -- that should be easy to do, by just having a flag that makes it greedy), or we should stop it on down, and then resume it when the horizontal drag doesn't win (using the onDragDown/onDragCancel pattern from tap).

I propose doing that in a separate pass though. This patch is still an improvement over the status quo.

@abarth
Copy link
Contributor

abarth commented Dec 25, 2015

LGTM

The DrawerController has the same issue as you describe for the followup patch. I think the DragDown/DragCancel pattern will scale better than a greedy flag (and we've already gone down that path for tap).

@abarth
Copy link
Contributor

abarth commented Dec 25, 2015

Another interesting case to look at is the Switch. Dragging the switch has a delay because the drag gesture is fighting with the tap gesture. However, the UX is arranged such that starting a drag and completing with a tap makes sense because they both want to drive the performance in the same direction.

@Hixie
Copy link
Contributor Author

Hixie commented Dec 26, 2015

My main concern with having onDragDown, onDragDownMove, and onDragCancel is that it adds at least nine events to GestureDetector. I agree that it's probably the right solution though.

@Hixie
Copy link
Contributor Author

Hixie commented Dec 26, 2015

Filed #1028

Hixie added a commit that referenced this pull request Dec 26, 2015
Catch dismissable while it's animating.
@Hixie Hixie merged commit c812628 into flutter:master Dec 26, 2015
@Hixie Hixie deleted the transform branch December 26, 2015 19:54
@Hixie
Copy link
Contributor Author

Hixie commented Dec 26, 2015

Also filed #1029 for the opacity regression.

@abarth
Copy link
Contributor

abarth commented Dec 26, 2015

My main concern with having onDragDown, onDragDownMove, and onDragCancel is that it adds at least nine events to GestureDetector. I agree that it's probably the right solution though.

We could switch how GestureDetector works so that it takes a TapGestureClient and a DragGestureClient as argument instead of individual callbacks. Then you'd mix them into your State object. That would also make it obvious which callbacks were grouped together into one gesture.

TahaTesser pushed a commit to NevercodeHQ/flutter that referenced this pull request Aug 13, 2020
Updates the example app README with all the steps required for enabling
the IAP APIs in Google Play and the App Store. Also adds a bit to the
plugin's generic README.

Changes the example app's android build script so that it requires the
package ID to be changed and signing keys added in order for it to be
ran. Users will need to set up their own package ID and signing keys for
the example app to work with `BillingClient`. Also adds `StoreKit` and
enables in app purchases to the XCode project.

flutter#25987
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

You can't catch a dismissable that's bouncing back
2 participants