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

Commit 5fec3c5c authored by Massimo Carli's avatar Massimo Carli Committed by Android (Google) Code Review
Browse files

Merge "[25/n] Handle animation for transparent activities" into main

parents a9139e0b 51eda6a6
Loading
Loading
Loading
Loading
+18 −15
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import android.animation.RectEvaluator
import android.animation.ValueAnimator
import android.graphics.Rect
import android.os.IBinder
import android.view.SurfaceControl
import android.view.SurfaceControl.Transaction
import android.window.TransitionInfo
import android.window.TransitionRequestInfo
@@ -104,7 +103,6 @@ class LetterboxAnimationHandler @Inject constructor(
                taskBounds,
                startBounds
            )
            val leash: SurfaceControl = change.leash
            val tx: Transaction = transactionSupplier.get()
            animExecutor.execute {
                boundsAnimator?.cancel()
@@ -137,8 +135,10 @@ class LetterboxAnimationHandler @Inject constructor(
            boundsAnimator?.addUpdateListener { animation ->
                val rect =
                    animation.getAnimatedValue() as Rect

                for (c in info.changes) {
                    tx.setPosition(
                    leash,
                        c.leash,
                        rect.left.toFloat(),
                        rect.top.toFloat()
                    ).apply {
@@ -150,8 +150,11 @@ class LetterboxAnimationHandler @Inject constructor(
                        )
                    }.apply()
                }
            }
            animExecutor.execute {
                tx.show(leash).apply()
                for (c in info.changes) {
                    tx.show(c.leash).apply()
                }
                boundsAnimator?.start()
            }
            return true
+8 −2
Original line number Diff line number Diff line
@@ -1191,11 +1191,17 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub
                if (currentTask != null) {
                    final ActivityRecord top = currentTask.topRunningActivity();
                    if (top != null) {
                        final ActivityRecord topOpaqueActivity = top.mAppCompatController
                                .getTransparentPolicy().getFirstOpaqueActivity().orElse(top);
                        if (chain.mTransition != null) {
                            chain.mTransition.collect(top);
                            // We also add the topOpaqueActivity if top is transparent.
                            if (top != topOpaqueActivity) {
                                chain.mTransition.collect(topOpaqueActivity);
                            }
                        top.mAppCompatController.getReachabilityPolicy().handleDoubleTap(doubleTapX,
                                doubleTapY);
                        }
                        topOpaqueActivity.mAppCompatController.getReachabilityPolicy()
                                .handleDoubleTap(doubleTapX, doubleTapY);
                    }
                }
                effects |= TRANSACT_EFFECTS_CLIENT_CONFIG;