summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRohit Yengisetty <rohit@cyngn.com>2015-07-01 17:21:05 -0700
committerRohit Yengisetty <rohit@cyngn.com>2015-07-01 17:21:05 -0700
commit95d537818b632915b315adba15b6b2d082f519f9 (patch)
treea9da13bb5dae29ee2bfae82dab8c79f3a6f0ac08
parentd8b2750c49cb03a1a1530187ea19e1954dffa5e0 (diff)
downloadpackages_apps_PhoneCommon-95d537818b632915b315adba15b6b2d082f519f9.tar.gz
packages_apps_PhoneCommon-95d537818b632915b315adba15b6b2d082f519f9.tar.bz2
packages_apps_PhoneCommon-95d537818b632915b315adba15b6b2d082f519f9.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: I0f1948d878f160ac3102e5cb46347295978a57fe
-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);
}
};