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

Support smoother completion animation for panning velocity #18

Merged
merged 2 commits into from
May 16, 2013

Conversation

kcharwood
Copy link
Contributor

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.

@kcharwood
Copy link
Contributor Author

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];
Copy link
Contributor

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.

@larsacus
Copy link
Contributor

This tiny change makes a marked difference in the panning completion feel. Nice catch!

@larsacus
Copy link
Contributor

If you haven't noticed, I've been pushing DRY to really try and get the .m file below 1000 lines. 😄

@kcharwood
Copy link
Contributor Author

Anything else need to go into this one? If not, I'll merge it.

@larsacus
Copy link
Contributor

Kittens. Other than that, no.

kcharwood added a commit that referenced this pull request May 16, 2013
Merging in. Thanks to @subdigital for reminding me to put this near the top of the queue.
@kcharwood kcharwood merged commit 8ce73cf into master May 16, 2013
@kcharwood kcharwood deleted the animation_velocity branch May 16, 2013 16:23
@kcharwood
Copy link
Contributor Author

Quick turnaround for @subdigital :)

@subdigital
Copy link

👍

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.

3 participants