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

Commit 0b2c8364 authored by Doris Liu's avatar Doris Liu
Browse files

Remove unnecessary value setting in AnimatorSet seeking

Also fixed seeking in paused state

BUG:68274315
BUG: 68382377
Test: ag/3835109
Change-Id: Ifa6b717a77a34f2152bd0e7ad285556986dd47ff
parent c3eb60ce
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -836,8 +836,6 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim
            lastPlayTime = duration - lastPlayTime;
            inReverse = false;
        }
        // Skip all values to start, and iterate mEvents to get animations to the right fraction.
        skipToStartValue(false);

        ArrayList<Node> unfinishedNodes = new ArrayList<>();
        // Assumes forward playing from here on.
@@ -872,6 +870,16 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim
            }
            node.mAnimation.animateBasedOnPlayTime(playTime, lastPlayTime, inReverse);
        }

        // Seek not yet started animations.
        for (int i = 0; i < mEvents.size(); i++) {
            AnimationEvent event = mEvents.get(i);
            if (event.getTime() > currentPlayTime
                    && event.mEvent == AnimationEvent.ANIMATION_DELAY_ENDED) {
                event.mNode.mAnimation.skipToEndValue(true);
            }
        }

    }

    @Override
@@ -923,7 +931,7 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim

        initAnimation();

        if (!isStarted()) {
        if (!isStarted() || isPaused()) {
            if (mReversing) {
                throw new UnsupportedOperationException("Error: Something went wrong. mReversing"
                        + " should not be set when AnimatorSet is not started.");
@@ -932,7 +940,6 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim
                findLatestEventIdForTime(0);
                // Set all the values to start values.
                initChildren();
                skipToStartValue(mReversing);
                mSeekState.setPlayTime(0, mReversing);
            }
            animateBasedOnPlayTime(playTime, 0, mReversing);