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

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

Merge "Not to remove the same animator twice" into qt-dev

parents 6ad38351 bcd41ee7
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -1947,19 +1947,24 @@ public abstract class Transition implements Cloneable {
     * @hide
     */
    void forceToEnd(ViewGroup sceneRoot) {
        ArrayMap<Animator, AnimationInfo> runningAnimators = getRunningAnimators();
        final ArrayMap<Animator, AnimationInfo> runningAnimators = getRunningAnimators();
        int numOldAnims = runningAnimators.size();
        if (sceneRoot != null) {
        if (sceneRoot == null || numOldAnims == 0) {
            return;
        }

        WindowId windowId = sceneRoot.getWindowId();
        final ArrayMap<Animator, AnimationInfo> oldAnimators = new ArrayMap(runningAnimators);
        runningAnimators.clear();

        for (int i = numOldAnims - 1; i >= 0; i--) {
                AnimationInfo info = runningAnimators.valueAt(i);
            AnimationInfo info = oldAnimators.valueAt(i);
            if (info.view != null && windowId != null && windowId.equals(info.windowId)) {
                    Animator anim = runningAnimators.keyAt(i);
                Animator anim = oldAnimators.keyAt(i);
                anim.end();
            }
        }
    }
    }

    /**
     * This method cancels a transition that is currently running.