diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 53297f260c..72d22137ea 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -78,7 +78,6 @@ import java.util.function.Consumer; public class DeviceProfile { private static final int DEFAULT_DOT_SIZE = 100; - private static final float ALL_APPS_TABLET_MAX_ROWS = 5.5f; private static final float MIN_FOLDER_TEXT_SIZE_SP = 16f; private static final float MIN_WIDGET_PADDING_DP = 6f; @@ -734,14 +733,9 @@ public class DeviceProfile { hotseatBorderSpace = cellLayoutBorderSpacePx.y; } - // AllApps height calculation depends on updated cellSize if (isTablet) { - int collapseHandleHeight = - res.getDimensionPixelOffset(R.dimen.bottom_sheet_handle_area_height); - int contentHeight = heightPx - collapseHandleHeight - hotseatQsbHeight; - int targetContentHeight = (int) (allAppsCellHeightPx * ALL_APPS_TABLET_MAX_ROWS); - allAppsPadding.top = Math.max(mInsets.top, contentHeight - targetContentHeight); - allAppsShiftRange = heightPx - allAppsPadding.top; + allAppsPadding.top = mInsets.top; + allAppsShiftRange = heightPx; } else { allAppsPadding.top = 0; allAppsShiftRange = diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java index 5721ed3493..1cbc5b6a20 100644 --- a/src/com/android/launcher3/InvariantDeviceProfile.java +++ b/src/com/android/launcher3/InvariantDeviceProfile.java @@ -247,7 +247,7 @@ public class InvariantDeviceProfile { public InvariantDeviceProfile(Context context, String gridName) { String newName = initGrid(context, gridName); if (newName == null || !newName.equals(gridName)) { - throw new IllegalArgumentException("Unknown grid name"); + throw new IllegalArgumentException("Unknown grid name: " + gridName); } } diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java index 7f1d216c95..4ad4c71a55 100644 --- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java @@ -1150,14 +1150,15 @@ public class ActivityAllAppsContainerView applyAdapterSideAndBottomPaddings(grid); - MarginLayoutParams mlp = (MarginLayoutParams) getLayoutParams(); - mlp.leftMargin = insets.left; - mlp.rightMargin = insets.right; - setLayoutParams(mlp); + // Ignore left/right insets on tablet because we are already centered in-screen. + if (grid.isPhone) { + MarginLayoutParams mlp = (MarginLayoutParams) getLayoutParams(); + mlp.leftMargin = insets.left; + mlp.rightMargin = insets.right; + setLayoutParams(mlp); + } - if (grid.isVerticalBarLayout() && !FeatureFlags.enableResponsiveWorkspace()) { - setPadding(grid.workspacePadding.left, 0, grid.workspacePadding.right, 0); - } else { + if (!grid.isVerticalBarLayout() || FeatureFlags.enableResponsiveWorkspace()) { int topPadding = grid.allAppsPadding.top; if (isSearchBarFloating() && !grid.isTablet) { topPadding += getResources().getDimensionPixelSize( diff --git a/tests/assets/dumpTests/DeviceProfileDumpTest/tabletLandscape.txt b/tests/assets/dumpTests/DeviceProfileDumpTest/tabletLandscape.txt index 0f27893f7a..92caf2315c 100644 --- a/tests/assets/dumpTests/DeviceProfileDumpTest/tabletLandscape.txt +++ b/tests/assets/dumpTests/DeviceProfileDumpTest/tabletLandscape.txt @@ -55,7 +55,7 @@ DeviceProfile: bottomSheetCloseDuration: 500 bottomSheetWorkspaceScale: 0.97 bottomSheetDepth: 0.0 - allAppsShiftRange: 1496.0px (748.0dp) + allAppsShiftRange: 1600.0px (800.0dp) allAppsOpenDuration: 500 allAppsCloseDuration: 500 allAppsIconSizePx: 120.0px (60.0dp) diff --git a/tests/assets/dumpTests/DeviceProfileDumpTest/tabletLandscape3Button.txt b/tests/assets/dumpTests/DeviceProfileDumpTest/tabletLandscape3Button.txt index 85f7ca1040..3815fa9c46 100644 --- a/tests/assets/dumpTests/DeviceProfileDumpTest/tabletLandscape3Button.txt +++ b/tests/assets/dumpTests/DeviceProfileDumpTest/tabletLandscape3Button.txt @@ -55,7 +55,7 @@ DeviceProfile: bottomSheetCloseDuration: 500 bottomSheetWorkspaceScale: 0.97 bottomSheetDepth: 0.0 - allAppsShiftRange: 1496.0px (748.0dp) + allAppsShiftRange: 1600.0px (800.0dp) allAppsOpenDuration: 500 allAppsCloseDuration: 500 allAppsIconSizePx: 120.0px (60.0dp) diff --git a/tests/assets/dumpTests/DeviceProfileDumpTest/tabletPortrait.txt b/tests/assets/dumpTests/DeviceProfileDumpTest/tabletPortrait.txt index bd47777343..7e0f3167c7 100644 --- a/tests/assets/dumpTests/DeviceProfileDumpTest/tabletPortrait.txt +++ b/tests/assets/dumpTests/DeviceProfileDumpTest/tabletPortrait.txt @@ -55,7 +55,7 @@ DeviceProfile: bottomSheetCloseDuration: 500 bottomSheetWorkspaceScale: 0.97 bottomSheetDepth: 0.0 - allAppsShiftRange: 2019.0px (1009.5dp) + allAppsShiftRange: 2560.0px (1280.0dp) allAppsOpenDuration: 500 allAppsCloseDuration: 500 allAppsIconSizePx: 120.0px (60.0dp) @@ -66,7 +66,7 @@ DeviceProfile: allAppsBorderSpacePxX: 16.0px (8.0dp) allAppsBorderSpacePxY: 32.0px (16.0dp) numShownAllAppsColumns: 6 - allAppsPadding.top: 541.0px (270.5dp) + allAppsPadding.top: 104.0px (52.0dp) allAppsPadding.left: 32.0px (16.0dp) allAppsPadding.right: 32.0px (16.0dp) allAppsLeftRightMargin: 152.0px (76.0dp) diff --git a/tests/assets/dumpTests/DeviceProfileDumpTest/tabletPortrait3Button.txt b/tests/assets/dumpTests/DeviceProfileDumpTest/tabletPortrait3Button.txt index 902885abb5..58c3890eb2 100644 --- a/tests/assets/dumpTests/DeviceProfileDumpTest/tabletPortrait3Button.txt +++ b/tests/assets/dumpTests/DeviceProfileDumpTest/tabletPortrait3Button.txt @@ -55,7 +55,7 @@ DeviceProfile: bottomSheetCloseDuration: 500 bottomSheetWorkspaceScale: 0.97 bottomSheetDepth: 0.0 - allAppsShiftRange: 2019.0px (1009.5dp) + allAppsShiftRange: 2560.0px (1280.0dp) allAppsOpenDuration: 500 allAppsCloseDuration: 500 allAppsIconSizePx: 120.0px (60.0dp) @@ -66,7 +66,7 @@ DeviceProfile: allAppsBorderSpacePxX: 16.0px (8.0dp) allAppsBorderSpacePxY: 32.0px (16.0dp) numShownAllAppsColumns: 6 - allAppsPadding.top: 541.0px (270.5dp) + allAppsPadding.top: 104.0px (52.0dp) allAppsPadding.left: 32.0px (16.0dp) allAppsPadding.right: 32.0px (16.0dp) allAppsLeftRightMargin: 152.0px (76.0dp) diff --git a/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelLandscape.txt b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelLandscape.txt index 43e4a604e6..1e363a245d 100644 --- a/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelLandscape.txt +++ b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelLandscape.txt @@ -55,7 +55,7 @@ DeviceProfile: bottomSheetCloseDuration: 500 bottomSheetWorkspaceScale: 0.97 bottomSheetDepth: 1.0 - allAppsShiftRange: 1730.0px (659.0476dp) + allAppsShiftRange: 1840.0px (700.9524dp) allAppsOpenDuration: 500 allAppsCloseDuration: 500 allAppsIconSizePx: 141.0px (53.714287dp) diff --git a/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelLandscape3Button.txt b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelLandscape3Button.txt index e7ea83982b..617b54b948 100644 --- a/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelLandscape3Button.txt +++ b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelLandscape3Button.txt @@ -55,7 +55,7 @@ DeviceProfile: bottomSheetCloseDuration: 500 bottomSheetWorkspaceScale: 0.97 bottomSheetDepth: 1.0 - allAppsShiftRange: 1730.0px (659.0476dp) + allAppsShiftRange: 1840.0px (700.9524dp) allAppsOpenDuration: 500 allAppsCloseDuration: 500 allAppsIconSizePx: 141.0px (53.714287dp) diff --git a/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait.txt b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait.txt index 043380c607..483b5e7922 100644 --- a/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait.txt +++ b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait.txt @@ -55,7 +55,7 @@ DeviceProfile: bottomSheetCloseDuration: 500 bottomSheetWorkspaceScale: 0.97 bottomSheetDepth: 1.0 - allAppsShiftRange: 2075.0px (790.4762dp) + allAppsShiftRange: 2208.0px (841.1429dp) allAppsOpenDuration: 500 allAppsCloseDuration: 500 allAppsIconSizePx: 141.0px (53.714287dp) diff --git a/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait3Button.txt b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait3Button.txt index a1b3e957e7..8d0640c9e7 100644 --- a/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait3Button.txt +++ b/tests/assets/dumpTests/DeviceProfileDumpTest/twoPanelPortrait3Button.txt @@ -55,7 +55,7 @@ DeviceProfile: bottomSheetCloseDuration: 500 bottomSheetWorkspaceScale: 0.97 bottomSheetDepth: 1.0 - allAppsShiftRange: 2075.0px (790.4762dp) + allAppsShiftRange: 2208.0px (841.1429dp) allAppsOpenDuration: 500 allAppsCloseDuration: 500 allAppsIconSizePx: 141.0px (53.714287dp)