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

Commit bd49cea1 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Bound the thumbnail insets to the launcher insets" into ub-launcher3-rvc-dev

parents 7f534cf2 895f57f6
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -195,11 +195,6 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
        updateThumbnailPaintFilter();
    }

    public void setSaturation(float saturation) {
        mSaturation = saturation;
        updateThumbnailPaintFilter();
    }

    public TaskOverlay getTaskOverlay() {
        return mOverlay;
    }
@@ -447,8 +442,8 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
            mClipBottom = -1;

            float scale = thumbnailData.scale;
            Rect thumbnailInsets = thumbnailData.insets;

            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()
@@ -521,6 +516,13 @@ public class TaskThumbnailView extends View implements PluginListener<OverviewSc
            mIsOrientationChanged = isOrientationDifferent;
        }

        private Rect getBoundedInsets(Rect activityInsets, Rect insets) {
            return new Rect(Math.min(insets.left, activityInsets.left),
                    Math.min(insets.top, activityInsets.top),
                    Math.min(insets.right, activityInsets.right),
                    Math.min(insets.bottom, activityInsets.bottom));
        }

        private int getRotationDelta(int oldRotation, int newRotation) {
            int delta = newRotation - oldRotation;
            if (delta < 0) delta += 4;