From 4981118478921c227fcba4f0991723efbc848a71 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Thu, 3 Jun 2021 09:52:40 -0700 Subject: [PATCH] Only inset widgets if workspaceTopPadding is greater than the widget padding. This prevents widget from becoming too close to status bar. Bug: 189724771 Test: manual Change-Id: I86f83b6a35bd2802bdbdf175340a379b498f481d --- src/com/android/launcher3/DeviceProfile.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index cdc09f10d6..e9245b0819 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -399,8 +399,10 @@ public class DeviceProfile { 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;