summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRohit Yengisetty <rohit@cyngn.com>2015-07-01 17:21:05 -0700
committerAbhisek Devkota <ciwrl@cyanogenmod.com>2015-07-09 12:33:22 -0700
commita4261e907e9ef46c6596d2f2d767d51478da0e01 (patch)
treef05237b82a742d906e7c6182be6b58f561f4fea6
parent0076ca8d6a12c4c4e08ddc364746c5cd652920d9 (diff)
downloadpackages_apps_PhoneCommon-a4261e907e9ef46c6596d2f2d767d51478da0e01.tar.gz
packages_apps_PhoneCommon-a4261e907e9ef46c6596d2f2d767d51478da0e01.tar.bz2
packages_apps_PhoneCommon-a4261e907e9ef46c6596d2f2d767d51478da0e01.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. LETTUCE-699 Change-Id: I0f1948d878f160ac3102e5cb46347295978a57fe (cherry picked from commit 95d537818b632915b315adba15b6b2d082f519f9)
-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);
}
};