diff options
author | Chet Haase <chet@google.com> | 2012-09-12 16:33:26 -0700 |
---|---|---|
committer | Chet Haase <chet@google.com> | 2012-09-12 16:33:26 -0700 |
commit | 4dd176864310e1d9519bf6b88918913e9927984f (patch) | |
tree | a781d631c16bc7917ef36ae0861d49827371775d /core/java/android/animation | |
parent | d428e95eb5bb0fe9ee4984c89c28bea3aff1b259 (diff) | |
download | frameworks_base-4dd176864310e1d9519bf6b88918913e9927984f.zip frameworks_base-4dd176864310e1d9519bf6b88918913e9927984f.tar.gz frameworks_base-4dd176864310e1d9519bf6b88918913e9927984f.tar.bz2 |
end() a reverse()'d animation correctly
Previously, an animator that had been reverse()'d (and was thus
playing backwards) would not end() at the right value. That is, a call
to end() would cause the animation to snap to its original end value, not
the reverse-playing end value (i.e., its start value). Logic to handle
calculating the proper end value was not taking the reversing behavior
into account.
Issue #6583656 When you call end() after calling reverse() on an animation that has not started leads to forward animation finishing.
Change-Id: Ifca60a32d4973c21b85aed9c459f802526c0207e
Diffstat (limited to 'core/java/android/animation')
-rwxr-xr-x | core/java/android/animation/ValueAnimator.java | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java index f874d56..f7460c4 100755 --- a/core/java/android/animation/ValueAnimator.java +++ b/core/java/android/animation/ValueAnimator.java @@ -958,13 +958,7 @@ public class ValueAnimator extends Animator { } else if (!mInitialized) { initAnimation(); } - // The final value set on the target varies, depending on whether the animation - // was supposed to repeat an odd number of times - if (mRepeatCount > 0 && (mRepeatCount & 0x01) == 1) { - animateValue(0f); - } else { - animateValue(1f); - } + animateValue(mPlayingBackwards ? 0f : 1f); endAnimation(handler); } |