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

Commit 6a2a8f53 authored by Mateusz Cicheński's avatar Mateusz Cicheński Committed by Android (Google) Code Review
Browse files

Merge "Fix enter pip animation in fixed rotation with KCA flag on" into tm-qpr-dev

parents 514a247b abd0fc80
Loading
Loading
Loading
Loading
+12 −15
Original line number Diff line number Diff line
@@ -1178,20 +1178,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,

        final Rect newDestinationBounds = mPipBoundsAlgorithm.getEntryDestinationBounds();
        if (newDestinationBounds.equals(currentDestinationBounds)) return;
        if (animator.getAnimationType() == ANIM_TYPE_BOUNDS) {
            if (mWaitForFixedRotation) {
                // The new destination bounds are in next rotation (DisplayLayout has been rotated
                // in computeRotatedBounds). The animation runs in previous rotation so the end
                // bounds need to be transformed.
                final Rect displayBounds = mPipBoundsState.getDisplayBounds();
                final Rect rotatedEndBounds = new Rect(newDestinationBounds);
                rotateBounds(rotatedEndBounds, displayBounds, mNextRotation, mCurrentRotation);
                animator.updateEndValue(rotatedEndBounds);
            } else {
                animator.updateEndValue(newDestinationBounds);
            }
        }
        animator.setDestinationBounds(newDestinationBounds);
        updateAnimatorBounds(newDestinationBounds);
        destinationBoundsOut.set(newDestinationBounds);
    }

@@ -1203,8 +1190,18 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
                mPipAnimationController.getCurrentAnimator();
        if (animator != null && animator.isRunning()) {
            if (animator.getAnimationType() == ANIM_TYPE_BOUNDS) {
                if (mWaitForFixedRotation) {
                    // The new destination bounds are in next rotation (DisplayLayout has been
                    // rotated in computeRotatedBounds). The animation runs in previous rotation so
                    // the end bounds need to be transformed.
                    final Rect displayBounds = mPipBoundsState.getDisplayBounds();
                    final Rect rotatedEndBounds = new Rect(bounds);
                    rotateBounds(rotatedEndBounds, displayBounds, mNextRotation, mCurrentRotation);
                    animator.updateEndValue(rotatedEndBounds);
                } else {
                    animator.updateEndValue(bounds);
                }
            }
            animator.setDestinationBounds(bounds);
        }
    }