From 5d35355fd18a0222c4a449ad022fcee6e471e6f4 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Fri, 14 May 2021 17:43:03 +0100 Subject: [PATCH] Use fixed width in overveiw grid - Removed thumbnail ratio logic in TaskView, getVisibleThumbnailRatio will be clean up separately - Removed quickswitch clipping and scaling, so overview and quickswitch looks identical. mClippedInsets will be clean up separately - Put focused task in center of screen - Refacotred CLearAllButton spacing Bug: 187839470 Test: Manual Change-Id: I2a7df1ac02acd5379af33f5b0e9abba0fab8e8d2 --- quickstep/res/values/dimens.xml | 6 +- .../quickstep/BaseActivityInterface.java | 16 +++--- .../android/quickstep/views/RecentsView.java | 56 +++---------------- .../quickstep/views/TaskThumbnailView.java | 12 ++-- .../com/android/quickstep/views/TaskView.java | 29 +++------- 5 files changed, 35 insertions(+), 84 deletions(-) diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml index 420c145fb3..72a37fcbf4 100644 --- a/quickstep/res/values/dimens.xml +++ b/quickstep/res/values/dimens.xml @@ -16,7 +16,7 @@ 48dp - 32dp + 40dp 2dp @@ -35,10 +35,10 @@ 16dp 77dp - 90dp + 70dp 54dp 42dp - 90dp + 40dp 110dp diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index 86bf1194bb..270a790b03 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -197,17 +197,18 @@ public abstract class BaseActivityInterface 1) { - taskWidth = boxLength; - taskHeight = (int) (boxLength / mFocusedTaskRatio); - } else { - taskWidth = (int) (boxLength * mFocusedTaskRatio); - taskHeight = boxLength; - } - } - return new Point(taskWidth, taskHeight); + return new Point(mTempRect.width(), mTempRect.height()); } /** Gets the last computed task size */ @@ -1589,13 +1576,6 @@ public abstract class RecentsView 1) { - expectedWidth = boxLength; - expectedHeight = (int) (boxLength / thumbnailRatio) + thumbnailPadding; - } else { - expectedWidth = (int) (boxLength * thumbnailRatio); - expectedHeight = boxLength + thumbnailPadding; - } + expectedWidth = boxWidth; + expectedHeight = boxHeight + thumbnailPadding; // Scale to to fit task Rect. fullscreenScale = taskWidth / (float) boxWidth; - // In full screen, scale back TaskView to original size. - if (expectedWidth > boxWidth) { - fullscreenScale *= boxWidth / (float) expectedWidth; - } else if (expectedHeight - thumbnailPadding > boxHeight) { - fullscreenScale *= boxHeight / (float) (expectedHeight - thumbnailPadding); - } - // Align to top of task Rect. boxTranslationY = (expectedHeight - thumbnailPadding - taskHeight) / 2.0f; } else {