Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4dd17686 authored by Chet Haase's avatar Chet Haase
Browse files

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
parent d428e95e
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -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);
    }