-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support smoother completion animation for panning velocity #18
Conversation
You've really gotta pull this one down and run it on a device to feel it. |
@@ -792,10 +802,10 @@ -(void)finishAnimationForPanGestureWithXVelocity:(CGFloat)xVelocity completion:( | |||
if(self.openSide == MMDrawerSideLeft) { | |||
CGFloat midPoint = self.maximumLeftDrawerWidth / 2.0; | |||
if(xVelocity > MMDrawerPanVelocityXAnimationThreshold){ | |||
[self openDrawerSide:MMDrawerSideLeft animated:YES completion:completion]; | |||
[self openDrawerSide:MMDrawerSideLeft animated:YES velocity:MAX(ABS(xVelocity),MMDrawerPanVelocityXAnimationThreshold*2) animationOptions:UIViewAnimationOptionCurveEaseOut completion:completion]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The velocity passed in here is the same in both places. Just break it out into a new animationVelocity
variable and use that in both places.
This tiny change makes a marked difference in the panning completion feel. Nice catch! |
If you haven't noticed, I've been pushing DRY to really try and get the |
Anything else need to go into this one? If not, I'll merge it. |
Kittens. Other than that, no. |
Merging in. Thanks to @subdigital for reminding me to put this near the top of the queue.
Quick turnaround for @subdigital :) |
👍 |
Right now we are using
UIViewAnimationOptionCurveEaseInOut
to complete panning animations, so there is a slight hiccup.We should get smarter and use
UIViewAnimationOptionCurveEaseOut
in that state, and let the pan velocity determine how fast it finishes.