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

Commit 85c0786e authored by Doris Liu's avatar Doris Liu Committed by Android (Google) Code Review
Browse files

Merge "Correct isRunning() behavior for AnimatorSet"

parents b1ecc00d ee684556
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -408,15 +408,18 @@ public final class AnimatorSet extends Animator {

    /**
     * Returns true if any of the child animations of this AnimatorSet have been started and have
     * not yet ended.
     * @return Whether this AnimatorSet has been started and has not yet ended.
     * not yet ended. Child animations will not be started until the AnimatorSet has gone past
     * its initial delay set through {@link #setStartDelay(long)}.
     *
     * @return Whether this AnimatorSet has gone past the initial delay, and at least one child
     *         animation has been started and not yet ended.
     */
    @Override
    public boolean isRunning() {
        int size = mNodes.size();
        for (int i = 0; i < size; i++) {
            Node node = mNodes.get(i);
            if (node != mRootNode && node.mAnimation.isRunning()) {
            if (node != mRootNode && node.mAnimation.isStarted()) {
                return true;
            }
        }