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

Commit fb092a9a authored by Vinit Nayak's avatar Vinit Nayak Committed by Android (Google) Code Review
Browse files

Revert "Launch split tasks at beginning of animation instead of the end"

This reverts commit 26c11f2c.

Reason for revert: b/333937249

Change-Id: Ide851596f5be7cea28df18dc27701b3cc0104bf1
parent 26c11f2c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -225,7 +225,11 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
        }

        mTaskbarLauncherStateController.updateStateForFlag(FLAG_VISIBLE, isVisible);
        if (fromInit) {
        // TODO(b/308851855): Skip animation for launching split from home, will refine later
        boolean skipAnimForSplit = enableSplitContextually() &&
                mLauncher.areBothSplitAppsConfirmed() &&
                mLauncher.getStateManager().getState() == LauncherState.NORMAL;
        if (skipAnimForSplit || fromInit) {
            duration = 0;
        }
        return mTaskbarLauncherStateController.applyState(duration, startAnimation);
+14 −20
Original line number Diff line number Diff line
@@ -880,30 +880,11 @@ class SplitAnimationController(val splitSelectStateController: SplitSelectStateC
            }
        }

        if (splitRoot1 != null) {
            // Set the highest level split root alpha; we could technically use the parent of
            // either splitRoot1 or splitRoot2
            val parentToken = splitRoot1.parent
            var rootLayer: Change? = null
            if (parentToken != null) {
                rootLayer = transitionInfo.getChange(parentToken)
            }
            if (rootLayer != null && rootLayer.leash != null) {
                openingTargets.add(rootLayer.leash)
            }
        }

        val animTransaction = Transaction()
        val animator = ValueAnimator.ofFloat(0f, 1f)
        animator.setDuration(QuickstepTransitionManager.SPLIT_LAUNCH_DURATION.toLong())
        animator.addUpdateListener { valueAnimator: ValueAnimator ->
            val progress =
                    Interpolators.clampToProgress(
                            Interpolators.LINEAR,
                            valueAnimator.animatedFraction,
                            0.8f,
                            1f
                    )
            val progress = valueAnimator.animatedFraction
            for (leash in openingTargets) {
                animTransaction.setAlpha(leash, progress)
            }
@@ -925,6 +906,19 @@ class SplitAnimationController(val splitSelectStateController: SplitSelectStateC
            }
        )

        if (splitRoot1 != null) {
            // Set the highest level split root alpha; we could technically use the parent of
            // either splitRoot1 or splitRoot2
            val parentToken = splitRoot1.parent
            var rootLayer: Change? = null
            if (parentToken != null) {
                rootLayer = transitionInfo.getChange(parentToken)
            }
            if (rootLayer != null && rootLayer.leash != null) {
                t.setAlpha(rootLayer.leash, 1f)
            }
        }

        t.apply()
        animator.start()
    }
+1 −5
Original line number Diff line number Diff line
@@ -171,11 +171,6 @@ public class SplitToWorkspaceController {
        pendingAnimation.addListener(new AnimatorListenerAdapter() {
            private boolean mIsCancelled = false;

            @Override
            public void onAnimationStart(Animator animation) {
                mController.launchSplitTasks(aBoolean -> cleanUp());
            }

            @Override
            public void onAnimationCancel(Animator animation) {
                mIsCancelled = true;
@@ -185,6 +180,7 @@ public class SplitToWorkspaceController {
            @Override
            public void onAnimationEnd(Animator animation) {
                if (!mIsCancelled) {
                    mController.launchSplitTasks(aBoolean -> cleanUp());
                    InteractionJankMonitorWrapper.end(Cuj.CUJ_SPLIT_SCREEN_ENTER);
                }
            }