Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54b54245 authored by Steven Ng's avatar Steven Ng Committed by Petr Cermak
Browse files

Revert "Deduct padding from widget size only if padding has been inset"

This reverts commit 71cefb59.

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
parent 71cefb59
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -99,13 +99,11 @@ public final class WidgetSizes {
     */
    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(