Merge "Only inset widgets if workspaceTopPadding is greater than the widget padding." into sc-dev am: 3ed65ede16 am: 328a2bd5ef am: df3caf7274
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14823934
Change-Id: I2e3aca701d66fa911e744d21737ff57117d0c0e6
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index cdc09f1..e9245b0 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -399,8 +399,10 @@
public boolean shouldInsetWidgets() {
Rect widgetPadding = inv.defaultWidgetPadding;
- // Check all sides to ensure that the widget won't overlap into another cell.
- return cellLayoutBorderSpacingPx > widgetPadding.left
+ // Check all sides to ensure that the widget won't overlap into another cell, or into
+ // status bar.
+ return workspaceTopPadding > widgetPadding.top
+ && cellLayoutBorderSpacingPx > widgetPadding.left
&& cellLayoutBorderSpacingPx > widgetPadding.top
&& cellLayoutBorderSpacingPx > widgetPadding.right
&& cellLayoutBorderSpacingPx > widgetPadding.bottom;