From 8175da9644ac682094f8176748e704968b69cc12 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Wed, 9 Mar 2022 11:19:47 +0000 Subject: [PATCH] Shrink hotseat icons size in large tablet portrait Fix: 214882090 Test: large tablet shrink hotseat icons size in both orientation Test: Launcher3 without inline QSB does not shrink hotseat icon size Change-Id: I5e325924aae056d42f01c08624b97a57359dbf08 --- src/com/android/launcher3/DeviceProfile.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index cd9bbf70df..84505d9f84 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -346,9 +346,14 @@ public class DeviceProfile { workspaceCellPaddingXPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_padding_x); hotseatQsbHeight = res.getDimensionPixelSize(R.dimen.qsb_widget_height); - isQsbInline = isLargeTablet && isLandscape && hotseatQsbHeight > 0; + // Whether QSB might be inline in appropriate orientation (landscape). + boolean canQsbInline = isLargeTablet && hotseatQsbHeight > 0; + isQsbInline = canQsbInline && isLandscape; - if (isTaskbarPresent && !isGestureMode && isQsbInline) { + // We shrink hotseat sizes regardless of orientation, if nav buttons are inline and QSB + // might be inline in either orientations, to keep hotseat size consistent across rotation. + boolean areNavButtonsInline = isTaskbarPresent && !isGestureMode; + if (areNavButtonsInline && canQsbInline) { numShownHotseatIcons = inv.numShrunkenHotseatIcons; } else { numShownHotseatIcons =