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
This commit is contained in:
Chet Haase
2013-09-06 07:59:36 -07:00
parent 2a59f3f240
commit f43fb2a57f

View File

@@ -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);
}