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

Commit 2af9d271 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revert "Deduct padding from widget size only if padding has been inset"" into sc-dev

parents 21780405 54b54245
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -99,13 +99,11 @@ public final class WidgetSizes {
     */
     */
    public static Bundle getWidgetSizeOptions(Context context, ComponentName provider, int spanX,
    public static Bundle getWidgetSizeOptions(Context context, ComponentName provider, int spanX,
            int spanY) {
            int spanY) {
        boolean shouldInsetWidgets =
                LauncherAppState.getIDP(context).getDeviceProfile(context).shouldInsetWidgets();
        ArrayList<SizeF> sizes = getWidgetSizes(context, spanX, spanY);
        ArrayList<SizeF> sizes = getWidgetSizes(context, spanX, spanY);
        Rect padding = getDefaultPaddingForWidget(context, provider, null);
        Rect padding = getDefaultPaddingForWidget(context, provider, null);
        float density = context.getResources().getDisplayMetrics().density;
        float density = context.getResources().getDisplayMetrics().density;
        float xPaddingDips = shouldInsetWidgets ? (padding.left + padding.right) / density : 0;
        float xPaddingDips = (padding.left + padding.right) / density;
        float yPaddingDips = shouldInsetWidgets ? (padding.top + padding.bottom) / density : 0;
        float yPaddingDips = (padding.top + padding.bottom) / density;


        ArrayList<SizeF> paddedSizes = sizes.stream()
        ArrayList<SizeF> paddedSizes = sizes.stream()
                .map(size -> new SizeF(
                .map(size -> new SizeF(