From bc42ba836ed8a5c9b97dbf65207fd2463cb2553a Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Tue, 8 Jun 2021 12:25:37 +0100 Subject: [PATCH] Consider TaskView's scale when calculating corner radius Bug: 190139030 Test: Manual Change-Id: I43fcb67848d30491bbfa58624f088c98ce433de4 --- .../src/com/android/quickstep/util/TaskViewSimulator.java | 4 ++-- quickstep/src/com/android/quickstep/views/TaskView.java | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java index b15bbf3ed2..0e6ce87042 100644 --- a/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +++ b/quickstep/src/com/android/quickstep/util/TaskViewSimulator.java @@ -256,8 +256,8 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { float fullScreenProgress = Utilities.boundToRange(this.fullScreenProgress.value, 0, 1); mCurrentFullscreenParams.setProgress( - fullScreenProgress, recentsViewScale.value, mTaskRect.width(), mDp, - mPositionHelper); + fullScreenProgress, recentsViewScale.value, /*taskViewScale=*/1f, mTaskRect.width(), + mDp, mPositionHelper); // Apply thumbnail matrix RectF insets = mCurrentFullscreenParams.mCurrentDrawnInsets; diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index ea37d70933..0e39dff05c 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -1353,6 +1353,7 @@ public class TaskView extends FrameLayout implements Reusable { mCurrentFullscreenParams.setProgress( mFullscreenProgress, getRecentsView().getScaleX(), + getScaleX(), getWidth(), mActivity.getDeviceProfile(), previewPositionHelper); } @@ -1494,8 +1495,8 @@ public class TaskView extends FrameLayout implements Reusable { /** * Sets the progress in range [0, 1] */ - public void setProgress(float fullscreenProgress, float parentScale, int previewWidth, - DeviceProfile dp, PreviewPositionHelper pph) { + public void setProgress(float fullscreenProgress, float parentScale, float taskViewScale, + int previewWidth, DeviceProfile dp, PreviewPositionHelper pph) { RectF insets = pph.getInsetsToDrawInFullscreen(); float currentInsetsLeft = insets.left * fullscreenProgress; @@ -1506,7 +1507,7 @@ public class TaskView extends FrameLayout implements Reusable { mCurrentDrawnCornerRadius = Utilities.mapRange(fullscreenProgress, mCornerRadius, fullscreenCornerRadius) - / parentScale; + / parentScale / taskViewScale; // We scaled the thumbnail to fit the content (excluding insets) within task view width. // Now that we are drawing left/right insets again, we need to scale down to fit them.