Bug 709817 - Don't clobber mState if animations are aborted. r=pcwalton

Ensure that if the animation is aborted by changing the value of
mState (such as if we get an onTouchStart and set the mState to
TOUCHING), then we don't clobber it and set it back to NOTHING.
Only set it back to NOTHING when the animation finishes normally.
This commit is contained in:
Kartikaya Gupta 2011-12-20 16:53:39 -05:00
parent 36b1a1f54b
commit a09efe8450

View File

@ -617,6 +617,7 @@ public class PanZoomController
/* Finally, if there's nothing else to do, complete the animation and go to sleep. */
finishBounce();
finishAnimation();
mState = PanZoomState.NOTHING;
}
/* Performs one frame of a bounce animation. */
@ -684,16 +685,17 @@ public class PanZoomController
*/
boolean overscrolledX = mX.getOverscroll() != Axis.Overscroll.NONE;
boolean overscrolledY = mY.getOverscroll() != Axis.Overscroll.NONE;
if (!mOverridePanning && (overscrolledX || overscrolledY))
if (!mOverridePanning && (overscrolledX || overscrolledY)) {
bounce();
else
} else {
finishAnimation();
mState = PanZoomState.NOTHING;
}
}
}
private void finishAnimation() {
Log.d(LOGTAG, "Finishing animation at " + mController.getViewportMetrics());
mState = PanZoomState.NOTHING;
stopAnimationTimer();
// Force a viewport synchronisation