From 50f9fc3c585ccc1e686d89a55a4f8c980e73843f Mon Sep 17 00:00:00 2001 From: Rohit Yengisetty Date: Wed, 1 Jul 2015 17:21:05 -0700 Subject: AnimUtils : clear listeners when animation completes or is terminated A few of the functions in AnimUtils set listeners on the ViewPropertyAnimator of the view they are animating. These listeners are never cleared after the animation is over or cancelled. They linger around and can be inadvertently triggered on another un-related animation. This change ensures that if a listener is set for a particular animation, it is cleared once the animation completes. Change-Id: If9cc269439880cc8ea277adb464114dcc4978e95 --- src/com/android/phone/common/animation/AnimUtils.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/com/android/phone/common/animation/AnimUtils.java b/src/com/android/phone/common/animation/AnimUtils.java index 118a12c..cdc71ee 100644 --- a/src/com/android/phone/common/animation/AnimUtils.java +++ b/src/com/android/phone/common/animation/AnimUtils.java @@ -60,6 +60,7 @@ public class AnimUtils { if (callback != null) { callback.onAnimationEnd(); } + fadeOut.animate().setListener(null); } @Override @@ -69,6 +70,7 @@ public class AnimUtils { if (callback != null) { callback.onAnimationCancel(); } + fadeOut.animate().setListener(null); } }); if (durationMs != DEFAULT_DURATION) { @@ -100,6 +102,7 @@ public class AnimUtils { if (callback != null) { callback.onAnimationCancel(); } + fadeIn.animate().setListener(null); } @Override @@ -107,6 +110,7 @@ public class AnimUtils { if (callback != null) { callback.onAnimationEnd(); } + fadeIn.animate().setListener(null); } }); if (durationMs != DEFAULT_DURATION) { @@ -147,6 +151,7 @@ public class AnimUtils { if (callback != null) { callback.onAnimationCancel(); } + view.animate().setListener(null); } @Override @@ -154,6 +159,7 @@ public class AnimUtils { if (callback != null) { callback.onAnimationEnd(); } + view.animate().setListener(null); } }); scaleInternal(view, 0 /* startScaleValue */, 1 /* endScaleValue */, durationMs, @@ -185,6 +191,7 @@ public class AnimUtils { if (callback != null) { callback.onAnimationEnd(); } + view.animate().setListener(null); } @Override @@ -195,6 +202,7 @@ public class AnimUtils { if (callback != null) { callback.onAnimationCancel(); } + view.animate().setListener(null); } }; -- cgit v1.2.3