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

Commit 142b054e authored by Andras Kloczl's avatar Andras Kloczl
Browse files

Tune widget picker bottom sheet VisD for large screen

Test: Open widget picker by long pressing the home screen.
Open app specific widget picker by long pressing an app icon
that has widgets. Try both landscape and portrait, also on
phone/tablet/foldable.
Bug: 214215594

Change-Id: I7b4b3a8d7421f1d4df84d49a18b465693a17bd7b
parent deae9343
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -15,6 +15,9 @@
-->

<resources>
<!-- AllApps -->
    <dimen name="all_apps_top_padding">0dp</dimen>
    <!-- Widget picker-->
    <dimen name="widget_list_horizontal_margin">49dp</dimen>

    <!-- Bottom sheet-->
    <dimen name="bottom_sheet_extra_top_padding">0dp</dimen>
</resources>
+6 −1
Original line number Diff line number Diff line
@@ -16,6 +16,11 @@

<resources>
<!-- AllApps -->
    <dimen name="all_apps_top_padding">300dp</dimen>
    <dimen name="all_apps_bottom_sheet_horizontal_padding">65dp</dimen>

<!-- Widget picker-->
    <dimen name="widget_list_horizontal_margin">30dp</dimen>

<!-- Bottom sheet-->
    <dimen name="bottom_sheet_extra_top_padding">300dp</dimen>
</resources>
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,6 @@

    <!-- All Apps -->
    <dimen name="all_apps_starting_vertical_translate">320dp</dimen>
    <dimen name="all_apps_top_padding">0dp</dimen>
    <dimen name="all_apps_search_bar_field_height">48dp</dimen>
    <!-- all_apps_search_bar_field_height / 2 -->
    <dimen name="all_apps_search_bar_content_overlap">24dp</dimen>
@@ -368,6 +367,7 @@
    <dimen name="padded_rounded_button_padding">8dp</dimen>

<!-- Bottom sheet related parameters -->
    <dimen name="bottom_sheet_extra_top_padding">0dp</dimen>
    <dimen name="bottom_sheet_handle_width">32dp</dimen>
    <dimen name="bottom_sheet_handle_height">4dp</dimen>
    <dimen name="bottom_sheet_handle_margin">16dp</dimen>
+6 −2
Original line number Diff line number Diff line
@@ -175,6 +175,7 @@ public class DeviceProfile {
    public Point allAppsBorderSpacePx;
    public int allAppsShiftRange;
    public int allAppsTopPadding;
    public int bottomSheetTopPadding;
    public int allAppsCellHeightPx;
    public int allAppsCellWidthPx;
    public int allAppsIconSizePx;
@@ -294,8 +295,11 @@ public class DeviceProfile {
        desiredWorkspaceHorizontalMarginPx = getHorizontalMarginPx(inv, res);
        desiredWorkspaceHorizontalMarginOriginalPx = desiredWorkspaceHorizontalMarginPx;

        allAppsTopPadding = res.getDimensionPixelSize(R.dimen.all_apps_top_padding)
                + (isTablet ? heightPx - availableHeightPx : 0);
        bottomSheetTopPadding = windowBounds.insets.top // statusbar height
                + res.getDimensionPixelSize(R.dimen.bottom_sheet_extra_top_padding)
                + (isTablet ? 0 : edgeMarginPx); // phones need edgeMarginPx additional padding

        allAppsTopPadding = isTablet ? bottomSheetTopPadding : 0;
        allAppsShiftRange = isTablet
                ? heightPx - allAppsTopPadding
                : res.getDimensionPixelSize(R.dimen.all_apps_starting_vertical_translate);
+1 −2
Original line number Diff line number Diff line
@@ -163,9 +163,8 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<Launcher>
            widthUsed = Math.max(widthUsed, minUsedWidth);
        }

        int heightUsed = mInsets.top + deviceProfile.edgeMarginPx;
        measureChildWithMargins(mContent, widthMeasureSpec,
                widthUsed, heightMeasureSpec, heightUsed);
                widthUsed, heightMeasureSpec, deviceProfile.bottomSheetTopPadding);
        setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec),
                MeasureSpec.getSize(heightMeasureSpec));
    }
Loading