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

Commit e54db4fb authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fixing cutouts insets not clipped properly during swipeup for rotated...

Merge "Fixing cutouts insets not clipped properly during swipeup for rotated activities" into ub-launcher3-rvc-qpr-dev am: 2ace6a25

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12327967

Change-Id: I6e3f28e464a8ca63840a53f1b35c86cf377c4ad4
parents d7285795 2ace6a25
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -479,17 +479,18 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
            boolean isOrientationDifferent;
            mClipBottom = -1;

            int thumbnailRotation = thumbnailData.rotation;
            int deltaRotate = getRotationDelta(currentRotation, thumbnailRotation);
            Rect thumbnailInsets = getBoundedInsets(
                    dp.getInsets(), thumbnailData.insets, deltaRotate);

            float scale = thumbnailData.scale;
            Rect activityInsets = dp.getInsets();
            Rect thumbnailInsets = getBoundedInsets(activityInsets, thumbnailData.insets);
            final float thumbnailWidth = thumbnailPosition.width()
                    - (thumbnailInsets.left + thumbnailInsets.right) * scale;
            final float thumbnailHeight = thumbnailPosition.height()
                    - (thumbnailInsets.top + thumbnailInsets.bottom) * scale;

            final float thumbnailScale;
            int thumbnailRotation = thumbnailData.rotation;
            int deltaRotate = getRotationDelta(currentRotation, thumbnailRotation);

            // Landscape vs portrait change
            boolean windowingModeSupportsRotation = !dp.isMultiWindowMode
@@ -558,7 +559,10 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
            mIsOrientationChanged = isOrientationDifferent;
        }

        private Rect getBoundedInsets(Rect activityInsets, Rect insets) {
        private Rect getBoundedInsets(Rect activityInsets, Rect insets, int deltaRotation) {
            if (deltaRotation != 0) {
                return insets;
            }
            return new Rect(Math.min(insets.left, activityInsets.left),
                    Math.min(insets.top, activityInsets.top),
                    Math.min(insets.right, activityInsets.right),