diff options
| author | 2013-09-06 07:59:36 -0700 | |
|---|---|---|
| committer | 2013-09-06 07:59:36 -0700 | |
| commit | f43fb2a57f152b5760d8792fec26f36d46b23817 (patch) | |
| tree | 4f4ede555b2bb0967201e05c016cb7ea8db9768b | |
| parent | 2a59f3f24076d96cbb10e1c00c3264dec43f19b1 (diff) | |
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
| -rw-r--r-- | core/java/android/animation/ValueAnimator.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java index 63942996c3e9..86da67383a27 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); } |