Prevent doubling up on split placeholder insets
This patch makes it so that the split placeholder uses only one inset for buffering the top of the icon: either the default split placeholder inset, or the device's built-in screen inset.
Currently, when we determine the size of the split placeholder, we add the placeholder's default inset to the device's built-in screen inset (camera cutouts, etc.). On some devices, this causes a very large combined inset, and it doesn't leave enough room for all the other UI elements, especially when 3-button mode is active. This patch cuts out one of the insets by selecting only one of the insets to respect (the larger one).
Fixes: 241164191
Test: Manual, checked all emulated inset types on a variety of screen sizes
Change-Id: Ica0e791bf4b8b757ad3fb87ab1cf3105b97a61dc
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 9a1bba9..ebda28f 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -218,6 +218,9 @@
public int overviewRowSpacing;
public int overviewGridSideMargin;
+ // Split staging
+ public int splitPlaceholderInset;
+
// Widgets
private final ViewScaleProvider mViewScaleProvider;
@@ -459,6 +462,8 @@
overviewRowSpacing = res.getDimensionPixelSize(R.dimen.overview_grid_row_spacing);
overviewGridSideMargin = res.getDimensionPixelSize(R.dimen.overview_grid_side_margin);
+ splitPlaceholderInset = res.getDimensionPixelSize(R.dimen.split_placeholder_inset);
+
// Calculate all of the remaining variables.
extraSpace = updateAvailableDimensions(res);