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

Commit b199da78 authored by Doris Liu's avatar Doris Liu
Browse files

Set end value immediately when start a 0-duration animation

This is to be consistent with pre-N behavior.

Bug: 27066791
Change-Id: I24cb7bc7645339a6e52be35a8cb15902b7d7bd5e
parent 28cfd20f
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -972,7 +972,14 @@ public class ValueAnimator extends Animator implements AnimationHandler.Animatio
            // to be consistent with the previous behavior. Otherwise, postpone this until the first
            // frame after the start delay.
            startAnimation();
            setCurrentFraction(mSeekFraction == -1 ? 0 : mSeekFraction);
            if (mSeekFraction == -1) {
                // No seek, start at play time 0. Note that the reason we are not using fraction 0
                // is because for animations with 0 duration, we want to be consistent with pre-N
                // behavior: skip to the final value immediately.
                setCurrentPlayTime(0);
            } else {
                setCurrentFraction(mSeekFraction);
            }
        }
    }