From bb594548bba74742c562b0889bbed52ad0fb0a69 Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Wed, 23 Jun 2021 15:16:39 -0700 Subject: [PATCH] [DO NOT MERGE] Make the cutout slightly smaller Temporary fix for S. Leaving the bug open for a proper fix in T. Since we reverted the z order back (launcher on top), we should apply this fix from S and find a proper solution in T Bug: 189265196 Test: https://screenshot.googleplex.com/75fgCva736rqwg5 Change-Id: Ice3b189a41f759e090334e360e44543eabc4836d (cherry picked from commit 26f47c711ad94e4f9f7daef7ea45b35b2e51f53f) --- .../android/quickstep/views/TaskThumbnailView.java | 14 ++++++++++++-- .../src/com/android/quickstep/views/TaskView.java | 3 +++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java index d91669ad96..da92551526 100644 --- a/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java +++ b/quickstep/src/com/android/quickstep/views/TaskThumbnailView.java @@ -19,6 +19,7 @@ package com.android.quickstep.views; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS; +import static com.android.launcher3.Utilities.comp; import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.systemui.shared.system.WindowManagerWrapper.WINDOWING_MODE_FULLSCREEN; @@ -290,8 +291,17 @@ public class TaskThumbnailView extends View { float cornerRadius) { if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { if (mTask != null && getTaskView().isRunningTask() && !getTaskView().showScreenshot()) { - canvas.drawRoundRect(x, y, width, height, cornerRadius, cornerRadius, mClearPaint); - canvas.drawRoundRect(x, y, width, height, cornerRadius, cornerRadius, + // TODO(b/189265196): Temporary fix to align the surface with the cutout perfectly. + // Round up only when the live tile task is displayed in Overview. + float rounding = comp(mFullscreenParams.mFullscreenProgress); + float left = x + rounding / 2; + float top = y + rounding / 2; + float right = width - rounding; + float bottom = height - rounding; + + canvas.drawRoundRect(left, top, right, bottom, cornerRadius, cornerRadius, + mClearPaint); + canvas.drawRoundRect(left, top, right, bottom, cornerRadius, cornerRadius, mDimmingPaintAfterClearing); return; } diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index e8077cf4a5..b122e7c3a2 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -1531,6 +1531,7 @@ public class TaskView extends FrameLayout implements Reusable { private final float mCornerRadius; private final float mWindowCornerRadius; + public float mFullscreenProgress; public RectF mCurrentDrawnInsets = new RectF(); public float mCurrentDrawnCornerRadius; /** The current scale we apply to the thumbnail to adjust for new left/right insets. */ @@ -1548,6 +1549,8 @@ public class TaskView extends FrameLayout implements Reusable { */ public void setProgress(float fullscreenProgress, float parentScale, float taskViewScale, int previewWidth, DeviceProfile dp, PreviewPositionHelper pph) { + mFullscreenProgress = fullscreenProgress; + RectF insets = pph.getInsetsToDrawInFullscreen(dp); float currentInsetsLeft = insets.left * fullscreenProgress;