From eaa6d682d487484a4b7799feb06c81b04f159f9b Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Tue, 17 Aug 2021 12:56:15 +0100 Subject: [PATCH] Support different task icon margin for grid tasks - Focused and non focused grid now have differnt margin between icon and snapshot - The overall margin above snapshot is still the same - Invoke updateChildTaskOrientations when focus task changes to update the margin - Also lowered the row spacing according to spec Bug: 194194694 Test: manual Change-Id: I25267bef19d5a8b1dc1cf96fc1babdc3ebc39330 --- quickstep/res/values/dimens.xml | 7 ++++--- .../com/android/quickstep/views/RecentsView.java | 4 +++- .../src/com/android/quickstep/views/TaskView.java | 13 +++++++------ res/values/dimens.xml | 1 + src/com/android/launcher3/DeviceProfile.java | 4 +++- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml index 659ff9a06a..658556eaac 100644 --- a/quickstep/res/values/dimens.xml +++ b/quickstep/res/values/dimens.xml @@ -32,7 +32,8 @@ 50dp 16dp - 12dp + 12dp + 4dp 48dp @@ -45,8 +46,8 @@ 16dp 50dp - 37.13dp - 33.38dp + 17.13dp + 13.38dp 0dp diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index d77c8ec105..86c3bf6a08 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -1262,6 +1262,7 @@ public abstract class RecentsView0dp 0dp 0dp + 0dp 0dp 0dp 0dp diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index b24aa06c00..d20738eef9 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -179,6 +179,7 @@ public class DeviceProfile { // Overview public final boolean overviewShowAsGrid; public int overviewTaskMarginPx; + public int overviewTaskMarginGridPx; public int overviewTaskIconSizePx; public int overviewTaskIconDrawableSizePx; public int overviewTaskIconDrawableSizeGridPx; @@ -353,8 +354,9 @@ public class DeviceProfile { overviewShowAsGrid = isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get(); overviewTaskMarginPx = overviewShowAsGrid - ? res.getDimensionPixelSize(R.dimen.overview_task_margin_grid) + ? res.getDimensionPixelSize(R.dimen.overview_task_margin_focused) : res.getDimensionPixelSize(R.dimen.overview_task_margin); + overviewTaskMarginGridPx = res.getDimensionPixelSize(R.dimen.overview_task_margin_grid); overviewTaskIconSizePx = res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_size); overviewTaskIconDrawableSizePx = res.getDimensionPixelSize(R.dimen.task_thumbnail_icon_drawable_size);