summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRohit Yengisetty <rohit@cyngn.com>2015-07-01 17:21:05 -0700
committerRohit Yengisetty <rohit@cyngn.com>2015-11-16 14:54:00 -0800
commit50f9fc3c585ccc1e686d89a55a4f8c980e73843f (patch)
tree6436899be0232dd9118c9875ba68a31f1307b53a
parenta0973eca4e4764456c49597574252eed61454f24 (diff)
downloadpackages_apps_PhoneCommon-50f9fc3c585ccc1e686d89a55a4f8c980e73843f.tar.gz
packages_apps_PhoneCommon-50f9fc3c585ccc1e686d89a55a4f8c980e73843f.tar.bz2
packages_apps_PhoneCommon-50f9fc3c585ccc1e686d89a55a4f8c980e73843f.zip
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
-rw-r--r--src/com/android/phone/common/animation/AnimUtils.java8
1 files changed, 8 insertions, 0 deletions
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);
}
};