From a09efe84502a1f5ba53088fd388feee4006aebc7 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Tue, 20 Dec 2011 16:53:39 -0500 Subject: [PATCH] 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. --- mobile/android/base/ui/PanZoomController.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mobile/android/base/ui/PanZoomController.java b/mobile/android/base/ui/PanZoomController.java index 021137b24f3..91a6f98df71 100644 --- a/mobile/android/base/ui/PanZoomController.java +++ b/mobile/android/base/ui/PanZoomController.java @@ -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