From f43fb2a57f152b5760d8792fec26f36d46b23817 Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Fri, 6 Sep 2013 07:59:36 -0700 Subject: [PATCH] Reversing immediately after starting animator ends it Previously, an animator that had started but not yet played its first frame would be reversed from its end state, which was not the desired behavior. Now, we detect that condition (started, but not yet actually running) and simply end() the animator immediately. Issue #10136266 ValueAnimator.reverse right after calling start() does the full animation Change-Id: I2a48d267336241ce74079c75758026c6f07ebc3a --- core/java/android/animation/ValueAnimator.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java index 63942996c3e9d..86da67383a27d 100644 --- a/core/java/android/animation/ValueAnimator.java +++ b/core/java/android/animation/ValueAnimator.java @@ -1027,6 +1027,8 @@ public class ValueAnimator extends Animator { long currentPlayTime = currentTime - mStartTime; long timeLeft = mDuration - currentPlayTime; mStartTime = currentTime - timeLeft; + } else if (mStarted) { + end(); } else { start(true); }