From 85d664efaa668f272895ca45b9f2f2b1197cae33 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Mon, 16 Jan 2023 16:31:59 +0000 Subject: [PATCH] Use transient taskbar size/margin to calculate taskbar position for persistent taskbar - DeviceProfileTest should use persistent taskbar in 3-button mode Fix: 260596114 Test: DeviceProfileTest Change-Id: Iadcca218dab2bc2eedc006c86dbbe3f9a0fa5e51 --- src/com/android/launcher3/DeviceProfile.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index f124940e3d..7b540d00c2 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -260,6 +260,7 @@ public class DeviceProfile { // Whether Taskbar will inset the bottom of apps by taskbarSize. public boolean isTaskbarPresentInApps; public int taskbarSize; + public int transientTaskbarSize; public int stashedTaskbarSize; public int transientTaskbarMargin; @@ -324,12 +325,12 @@ public class DeviceProfile { } if (isTaskbarPresent) { + transientTaskbarSize = res.getDimensionPixelSize(R.dimen.transient_taskbar_size); + transientTaskbarMargin = res.getDimensionPixelSize(R.dimen.transient_taskbar_margin); if (DisplayController.isTransientTaskbar(context)) { - taskbarSize = res.getDimensionPixelSize(R.dimen.transient_taskbar_size); + taskbarSize = transientTaskbarSize; stashedTaskbarSize = res.getDimensionPixelSize(R.dimen.transient_taskbar_stashed_size); - transientTaskbarMargin = - res.getDimensionPixelSize(R.dimen.transient_taskbar_margin); } else { taskbarSize = res.getDimensionPixelSize(R.dimen.taskbar_size); stashedTaskbarSize = res.getDimensionPixelSize(R.dimen.taskbar_stashed_size); @@ -1383,7 +1384,7 @@ public class DeviceProfile { public int getOverviewActionsClaimedSpaceBelow() { if (isTaskbarPresent) { if (FeatureFlags.ENABLE_TASKBAR_IN_OVERVIEW.get()) { - return taskbarSize + transientTaskbarMargin * 2; + return transientTaskbarSize + transientTaskbarMargin * 2; } return isGestureMode