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

Commit 1cc90d80 authored by Shamali Patwa's avatar Shamali Patwa Committed by Android (Google) Code Review
Browse files

Merge "Fix issue that widget picker is only half of screen in foldable." into main

parents fc02f88d be55f82f
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -81,6 +81,9 @@ public class DeviceProfile {
    private static final float MIN_FOLDER_TEXT_SIZE_SP = 16f;
    private static final float MIN_WIDGET_PADDING_DP = 6f;

    // Minimum aspect ratio beyond which an extra top padding may be applied to a bottom sheet.
    private static final float MIN_ASPECT_RATIO_FOR_EXTRA_TOP_PADDING = 1.5f;

    public static final PointF DEFAULT_SCALE = new PointF(1.0f, 1.0f);
    public static final ViewScaleProvider DEFAULT_PROVIDER = itemInfo -> DEFAULT_SCALE;
    public static final Consumer<DeviceProfile> DEFAULT_DIMENSION_PROVIDER = dp -> {
@@ -414,8 +417,14 @@ public class DeviceProfile {
        gridVisualizationPaddingY = res.getDimensionPixelSize(
                R.dimen.grid_visualization_vertical_cell_spacing);

        // Tablet portrait mode uses a single pane widget picker and extra padding may be applied on
        // top to avoid making it look too elongated.
        final boolean applyExtraTopPadding = isTablet
                && !isLandscape
                && (aspectRatio > MIN_ASPECT_RATIO_FOR_EXTRA_TOP_PADDING);
        bottomSheetTopPadding = mInsets.top // statusbar height
                + res.getDimensionPixelSize(R.dimen.bottom_sheet_extra_top_padding)
                + (applyExtraTopPadding ? res.getDimensionPixelSize(
                R.dimen.bottom_sheet_extra_top_padding) : 0)
                + (isTablet ? 0 : edgeMarginPx); // phones need edgeMarginPx additional padding
        bottomSheetOpenDuration = res.getInteger(R.integer.config_bottomSheetOpenDuration);
        bottomSheetCloseDuration = res.getInteger(R.integer.config_bottomSheetCloseDuration);