Revert "Deduct padding from widget size only if padding has been inset"
This reverts commit 71cefb593f99ab2d19d1b70335be8c7886040469.
Reason for revert: The default padding is added by the framework not the launcher. We really need to subtract padding from the size.
Bug: 190498032
Change-Id: If7f164da34aec3d8e022ef2c752b72292cca0489
diff --git a/src/com/android/launcher3/widget/util/WidgetSizes.java b/src/com/android/launcher3/widget/util/WidgetSizes.java
index fcc0dde..5c8ea72 100644
--- a/src/com/android/launcher3/widget/util/WidgetSizes.java
+++ b/src/com/android/launcher3/widget/util/WidgetSizes.java
@@ -99,13 +99,11 @@
*/
public static Bundle getWidgetSizeOptions(Context context, ComponentName provider, int spanX,
int spanY) {
- boolean shouldInsetWidgets =
- LauncherAppState.getIDP(context).getDeviceProfile(context).shouldInsetWidgets();
ArrayList<SizeF> sizes = getWidgetSizes(context, spanX, spanY);
Rect padding = getDefaultPaddingForWidget(context, provider, null);
float density = context.getResources().getDisplayMetrics().density;
- float xPaddingDips = shouldInsetWidgets ? (padding.left + padding.right) / density : 0;
- float yPaddingDips = shouldInsetWidgets ? (padding.top + padding.bottom) / density : 0;
+ float xPaddingDips = (padding.left + padding.right) / density;
+ float yPaddingDips = (padding.top + padding.bottom) / density;
ArrayList<SizeF> paddedSizes = sizes.stream()
.map(size -> new SizeF(