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

Commit c9abaa82 authored by yoshiki iguchi's avatar yoshiki iguchi Committed by android-build-merger
Browse files

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

am: 0000b852

Change-Id: I4d905845d774937df098eb4f6037cd1e70808941
parents f71a0829 0000b852
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.