From d15e94f0309a91d5a75d03a9ae165121e7f24907 Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Thu, 22 Jan 2015 17:57:37 -0800 Subject: 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 --- core/java/android/animation/ValueAnimator.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java index 8b70ae6..9709555 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(); -- cgit v1.1