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

Commit f54b88d2 authored by Johannes Gallmann's avatar Johannes Gallmann
Browse files

Add onEndCallback to ContainerAnimationRunner

Bug: 247121782
Test: Manual, i.e. tested that callback is invoked after launch animation
Change-Id: Ie52ffa1b76de01943dd16346560768b3ecced118
parent 86d8db48
Loading
Loading
Loading
Loading
+10 −3
Original line number Original line Diff line number Diff line
@@ -299,7 +299,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
        ItemInfo tag = (ItemInfo) v.getTag();
        ItemInfo tag = (ItemInfo) v.getTag();
        if (tag != null && tag.shouldUseBackgroundAnimation()) {
        if (tag != null && tag.shouldUseBackgroundAnimation()) {
            ContainerAnimationRunner containerAnimationRunner =
            ContainerAnimationRunner containerAnimationRunner =
                    ContainerAnimationRunner.from(v, mStartingWindowListener);
                    ContainerAnimationRunner.from(v, mStartingWindowListener, onEndCallback);
            if (containerAnimationRunner != null) {
            if (containerAnimationRunner != null) {
                delegateRunner = containerAnimationRunner;
                delegateRunner = containerAnimationRunner;
            }
            }
@@ -1757,7 +1757,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener


        @Nullable
        @Nullable
        private static ContainerAnimationRunner from(
        private static ContainerAnimationRunner from(
                View v, StartingWindowListener startingWindowListener) {
                View v, StartingWindowListener startingWindowListener, RunnableList onEndCallback) {
            View viewToUse = findViewWithBackground(v);
            View viewToUse = findViewWithBackground(v);
            if (viewToUse == null) {
            if (viewToUse == null) {
                viewToUse = v;
                viewToUse = v;
@@ -1784,8 +1784,15 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
            ActivityLaunchAnimator.Callback callback = task -> ColorUtils.setAlphaComponent(
            ActivityLaunchAnimator.Callback callback = task -> ColorUtils.setAlphaComponent(
                    startingWindowListener.getBackgroundColor(), 255);
                    startingWindowListener.getBackgroundColor(), 255);


            ActivityLaunchAnimator.Listener listener = new ActivityLaunchAnimator.Listener() {
                @Override
                public void onLaunchAnimationEnd() {
                    onEndCallback.executeAllAndDestroy();
                }
            };

            return new ContainerAnimationRunner(
            return new ContainerAnimationRunner(
                    new ActivityLaunchAnimator.AnimationDelegate(controller, callback));
                    new ActivityLaunchAnimator.AnimationDelegate(controller, callback, listener));
        }
        }


        /** Finds the closest parent of [view] (inclusive) with a background drawable. */
        /** Finds the closest parent of [view] (inclusive) with a background drawable. */