summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chet Haase <chet@google.com> 2015-01-22 17:57:37 -0800
committer Chet Haase <chet@google.com> 2015-01-23 02:07:00 +0000
commitd15e94f0309a91d5a75d03a9ae165121e7f24907 (patch)
treec121f46a32985bb7896848d0a4621a2499bfd3e4
parent7fde5e5ba3d306bc694e2b97edf5892755fcb6d0 (diff)
Allow infinite-repeat zero-duration animators to continue repeating
A recent change to ValueAnimator caused infinitely repeating animators with duration 0 to be ended immediately. BatterySaver mode can cause animators to have 0 duration, which means that apps depending on animator update events no longer receive those events due to this behavior change. The fix is to restore the previous behavior of allowing repeating animators to continue, regardless of duration. Issue #19113776 Fix infinite-repeating, zero-duration animator behavior Change-Id: I4d1c7afb6d06ca45ef41db73c160f6a6d5754e24
-rw-r--r--core/java/android/animation/ValueAnimator.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java
index 8b70ae616ae6..97095553403b 100644
--- a/core/java/android/animation/ValueAnimator.java
+++ b/core/java/android/animation/ValueAnimator.java
@@ -1273,8 +1273,7 @@ public class ValueAnimator extends Animator {
}
}
if (fraction >= 1f) {
- if (mCurrentIteration < mRepeatCount ||
- (mRepeatCount == INFINITE && mDuration != 0)) {
+ if (mCurrentIteration < mRepeatCount || mRepeatCount == INFINITE) {
// Time to repeat
if (mListeners != null) {
int numListeners = mListeners.size();