From 5637b7d2396636886688cf67ba1446882cc5fbfb Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Thu, 28 Aug 2014 07:53:59 -0700 Subject: [PATCH] Canceling ViewPropertyAnimator now removes pending actions Normally, calling cancel() on ViewPropertyAnimator() will cancel any running animations as well as any associated actions (layers and start/end actions). But if the animation is canceled before the first frame, these other actions are still pending and will not be canceled. This fix also cancels these pending actions. Issue #17296082 VPA.cancel() doesn't clear the end action Change-Id: If104d21c1e2d64516500048a06ba217284732ef0 --- core/java/android/view/ViewPropertyAnimator.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/java/android/view/ViewPropertyAnimator.java b/core/java/android/view/ViewPropertyAnimator.java index bae0cfbfc2420..b73b9fa07933e 100644 --- a/core/java/android/view/ViewPropertyAnimator.java +++ b/core/java/android/view/ViewPropertyAnimator.java @@ -430,6 +430,10 @@ public class ViewPropertyAnimator { } } mPendingAnimations.clear(); + mPendingSetupAction = null; + mPendingCleanupAction = null; + mPendingOnStartAction = null; + mPendingOnEndAction = null; mView.removeCallbacks(mAnimationStarter); if (mRTBackend != null) { mRTBackend.cancelAll();