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

Commit 9ae2affb authored by Luca Zuccarini's avatar Luca Zuccarini Committed by Android (Google) Code Review
Browse files

Merge "Always put the opening window above the origin launchable." into main

parents 3f23bc28 67306b1e
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -2103,3 +2103,10 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "move_transition_animation_layer"
    namespace: "systemui"
    description: "Enables moving the launching window on top of the origin window in the Animation library."
    bug: "390422470"
}
+23 −2
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ import com.android.app.animation.Interpolators
import com.android.internal.annotations.VisibleForTesting
import com.android.internal.policy.ScreenDecorationsUtils
import com.android.systemui.Flags.activityTransitionUseLargestWindow
import com.android.systemui.Flags.moveTransitionAnimationLayer
import com.android.systemui.Flags.translucentOccludingActivityFix
import com.android.systemui.animation.TransitionAnimator.Companion.assertLongLivedReturnAnimations
import com.android.systemui.animation.TransitionAnimator.Companion.assertReturnAnimations
@@ -1514,6 +1515,20 @@ constructor(
                            )
                        }

                        if (moveTransitionAnimationLayer()) {
                            // Ensure that the launching window is rendered above the view's window,
                            // so it is not obstructed.
                            // TODO(b/397180418): re-use the start transaction once the
                            //  RemoteAnimation wrapper is cleaned up.
                            SurfaceControl.Transaction().use {
                                it.reparent(
                                    window.leash,
                                    controller.transitionContainer.viewRootImpl.surfaceControl,
                                )
                                it.apply()
                            }
                        }

                        if (startTransaction != null) {
                            // Calling applyStateToWindow() here avoids skipping a frame when taking
                            // over an animation.
@@ -1566,12 +1581,18 @@ constructor(
                } else {
                    null
                }
            val fadeWindowBackgroundLayer =
                if (moveTransitionAnimationLayer()) {
                    false
                } else {
                    !controller.isBelowAnimatingWindow
                }
            animation =
                transitionAnimator.startAnimation(
                    controller,
                    endState,
                    windowBackgroundColor,
                    fadeWindowBackgroundLayer = !controller.isBelowAnimatingWindow,
                    fadeWindowBackgroundLayer = fadeWindowBackgroundLayer,
                    drawHole = !controller.isBelowAnimatingWindow,
                    startVelocity = velocityPxPerS,
                    startFrameTime = windowState?.timestamp ?: -1,
@@ -1685,7 +1706,7 @@ constructor(
            // fade in progressively. Otherwise, it should be fully opaque and will be progressively
            // revealed as the window background color layer above the window fades out.
            val alpha =
                if (controller.isBelowAnimatingWindow) {
                if (moveTransitionAnimationLayer() || controller.isBelowAnimatingWindow) {
                    if (controller.isLaunching) {
                        interpolators.contentAfterFadeInInterpolator.getInterpolation(
                            windowProgress
+7 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import com.android.app.animation.Interpolators.LINEAR
import com.android.internal.annotations.VisibleForTesting
import com.android.internal.dynamicanimation.animation.SpringAnimation
import com.android.internal.dynamicanimation.animation.SpringForce
import com.android.systemui.Flags.moveTransitionAnimationLayer
import com.android.systemui.shared.Flags.returnAnimationFrameworkLibrary
import com.android.systemui.shared.Flags.returnAnimationFrameworkLongLived
import java.util.concurrent.Executor
@@ -509,6 +510,8 @@ class TransitionAnimator(
     * punching a hole in the [transition container][Controller.transitionContainer]) iff [drawHole]
     * is true.
     *
     * TODO(b/397646693): remove drawHole altogether.
     *
     * If [startVelocity] (expressed in pixels per second) is not null, a multi-spring animation
     * using it for the initial momentum will be used instead of the default interpolators. In this
     * case, [startFrameTime] (if non-negative) represents the frame time at which the springs
@@ -1183,6 +1186,10 @@ class TransitionAnimator(
                if (drawHole) {
                    drawable.setXfermode(SRC_MODE)
                }
            } else if (moveTransitionAnimationLayer() && fadeOutProgress >= 1 && drawHole) {
                // If [drawHole] is true, draw it once the opening content is done fading in.
                drawable.alpha = 0x00
                drawable.setXfermode(SRC_MODE)
            } else {
                drawable.alpha = 0xFF
            }
+0 −0

File moved.

+0 −0

File moved.

Loading