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

Commit 269eab53 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update the mTotalDuration for each animation in an AnimatorSet."

parents 2aedabda 7fb80f7d
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1651,6 +1651,8 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim
        int childrenSize = parent.mChildNodes.size();
        for (int i = 0; i < childrenSize; i++) {
            Node child = parent.mChildNodes.get(i);
            child.mTotalDuration = child.mAnimation.getTotalDuration();  // Update cached duration.

            int index = visited.indexOf(child);
            if (index >= 0) {
                // Child has been visited, cycle found. Mark all the nodes in the cycle.
@@ -1677,9 +1679,8 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim
                        child.mStartTime = parent.mEndTime;
                    }

                    long duration = child.mAnimation.getTotalDuration();
                    child.mEndTime = duration == DURATION_INFINITE ?
                            DURATION_INFINITE : child.mStartTime + duration;
                    child.mEndTime = child.mTotalDuration == DURATION_INFINITE
                            ? DURATION_INFINITE : child.mStartTime + child.mTotalDuration;
                }
            }
            updatePlayTime(child, visited);