Better handling of insets for All Apps.
Changes:
- For tablet, always center All Apps without applying additional
insets for things like cutouts.
- For tablet, allow the panel to span the full height of the
screen (minus system bars), rather than 5.5 app rows. This also
ensures the panel fully closes even if there are cutouts.
- Remove additional padding for vertical bar mode (landscape on
phones). This was double counting the cutout insets, but only
for some views, so things were not aligned. Now the apps line
up with the search bar, and the scroll bar still makes room for
any side insets.
Before and after examples:
https://drive.google.com/drive/folders/1k0vSzisf4ZuGyp-qR-IF0QwM-IcHBFrZ?resourcekey=0-uxjzuVQ1KA3WwOQ4v6Dh2w&usp=drive_link
Bug: 299923399
Bug: 259617884
Fix: 300761324
Test: Manual
Flag: NA
Change-Id: I136d516260a1343b1198693c73fa389fe0e11cc9
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 53297f2..72d2213 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -78,7 +78,6 @@
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 @@
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 =