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

Commit 3f5aefb0 authored by Merissa Mitchell's avatar Merissa Mitchell Committed by Android (Google) Code Review
Browse files

Merge "Enable rounded corners when PiP exits to fullscreen." into main

parents cdd5a02c df488c13
Loading
Loading
Loading
Loading
+12 −21
Original line number Diff line number Diff line
@@ -497,13 +497,8 @@ public class PipAnimationController {
            mCurrentValue = value;
        }

        boolean shouldApplyCornerRadius() {
            return !isOutPipDirection(mTransitionDirection);
        }

        boolean shouldApplyShadowRadius() {
            return !isOutPipDirection(mTransitionDirection)
                    && !isRemovePipDirection(mTransitionDirection);
            return !isRemovePipDirection(mTransitionDirection);
        }

        boolean inScaleTransition() {
@@ -556,7 +551,7 @@ public class PipAnimationController {
                    final float alpha = getStartValue() * (1 - fraction) + getEndValue() * fraction;
                    setCurrentValue(alpha);
                    getSurfaceTransactionHelper().alpha(tx, leash, alpha)
                            .round(tx, leash, shouldApplyCornerRadius())
                            .round(tx, leash, true /* applyCornerRadius */)
                            .shadow(tx, leash, shouldApplyShadowRadius());
                    if (!handlePipTransaction(leash, tx, destinationBounds, alpha)) {
                        tx.apply();
@@ -572,7 +567,7 @@ public class PipAnimationController {
                    getSurfaceTransactionHelper()
                            .resetScale(tx, leash, getDestinationBounds())
                            .crop(tx, leash, getDestinationBounds())
                            .round(tx, leash, shouldApplyCornerRadius())
                            .round(tx, leash, true /* applyCornerRadius */)
                            .shadow(tx, leash, shouldApplyShadowRadius());
                    tx.show(leash);
                    tx.apply();
@@ -686,14 +681,12 @@ public class PipAnimationController {
                        getSurfaceTransactionHelper().scaleAndCrop(tx, leash,
                                adjustedSourceRectHint, initialSourceValue, bounds, insets,
                                isInPipDirection, fraction);
                        if (shouldApplyCornerRadius()) {
                        final Rect sourceBounds = new Rect(initialContainerRect);
                        sourceBounds.inset(insets);
                        getSurfaceTransactionHelper()
                                .round(tx, leash, sourceBounds, bounds)
                                .shadow(tx, leash, shouldApplyShadowRadius());
                    }
                    }
                    if (!handlePipTransaction(leash, tx, bounds, /* alpha= */ 1f)) {
                        tx.apply();
                    }
@@ -741,11 +734,9 @@ public class PipAnimationController {
                            .rotateAndScaleWithCrop(tx, leash, initialContainerRect, bounds,
                                    insets, degree, x, y, isOutPipDirection,
                                    rotationDelta == ROTATION_270 /* clockwise */);
                    if (shouldApplyCornerRadius()) {
                    getSurfaceTransactionHelper()
                            .round(tx, leash, sourceBounds, bounds)
                            .shadow(tx, leash, shouldApplyShadowRadius());
                    }
                    if (!handlePipTransaction(leash, tx, bounds, 1f /* alpha */)) {
                        tx.apply();
                    }
@@ -761,7 +752,7 @@ public class PipAnimationController {
                void onStartTransaction(SurfaceControl leash, SurfaceControl.Transaction tx) {
                    getSurfaceTransactionHelper()
                            .alpha(tx, leash, 1f)
                            .round(tx, leash, shouldApplyCornerRadius())
                            .round(tx, leash, true /* applyCornerRadius */)
                            .shadow(tx, leash, shouldApplyShadowRadius());
                    tx.show(leash);
                    tx.apply();