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

Commit 07ca884e authored by Brandon Dayauon's avatar Brandon Dayauon
Browse files

App row padding is now consistent for all grid sizes. Also fix when 2x2 allApp icons get super big.

Added consistent padding to each app row.

Bug: 229789736
Bug: 229791507
Bug: 228320417
Bug: 230870213
Test: Manual on Raven

Change-Id: Ice1c8be361f009994a8e0960a30da04fc1c0c218
parent 8909fc2d
Loading
Loading
Loading
Loading
+29 −23
Original line number Diff line number Diff line
@@ -63,6 +63,11 @@
    <dimen name="drop_target_top_margin">32dp</dimen>
    <dimen name="drop_target_bottom_margin">16dp</dimen>

    <!-- App Widget resize frame -->
    <!-- Button drop target bar -->
    <dimen name="button_drop_target_min_text_size">10sp</dimen>
    <dimen name="button_drop_target_resize_text_increment">1sp</dimen>

    <!-- App Widget resize frame -->
    <dimen name="widget_handle_margin">13dp</dimen>
    <dimen name="resize_frame_background_padding">24dp</dimen>
@@ -129,6 +134,7 @@
    <dimen name="all_apps_paged_view_top_padding">40dp</dimen>
    <dimen name="all_apps_personal_work_tabs_vertical_margin">16dp</dimen>

    <dimen name="all_apps_icon_drawable_padding">8dp</dimen>
    <!-- The size of corner radius of the arrow in the arrow toast. -->
    <dimen name="arrow_toast_corner_radius">2dp</dimen>
    <dimen name="arrow_toast_elevation">2dp</dimen>
+20 −0
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@
            launcher:minHeightDps="300"
            launcher:iconImageSize="48"
            launcher:iconTextSize="13.0"
            launcher:allAppsBorderSpace="16"
            launcher:allAppsCellHeight="104"
            launcher:canBeDefault="true" />

        <display-option
@@ -42,6 +44,8 @@
            launcher:minHeightDps="400"
            launcher:iconImageSize="48"
            launcher:iconTextSize="13.0"
            launcher:allAppsBorderSpace="16"
            launcher:allAppsCellHeight="104"
            launcher:canBeDefault="true" />

    </grid-option>
@@ -63,6 +67,8 @@
            launcher:minHeightDps="420"
            launcher:iconImageSize="48"
            launcher:iconTextSize="13.0"
            launcher:allAppsBorderSpace="16"
            launcher:allAppsCellHeight="104"
            launcher:canBeDefault="true" />

        <display-option
@@ -71,6 +77,8 @@
            launcher:minHeightDps="450"
            launcher:iconImageSize="48"
            launcher:iconTextSize="13.0"
            launcher:allAppsBorderSpace="16"
            launcher:allAppsCellHeight="104"
            launcher:canBeDefault="true" />

        <display-option
@@ -79,6 +87,8 @@
            launcher:minHeightDps="491.33"
            launcher:iconImageSize="48"
            launcher:iconTextSize="13.0"
            launcher:allAppsBorderSpace="16"
            launcher:allAppsCellHeight="104"
            launcher:canBeDefault="true" />

        <display-option
@@ -87,6 +97,8 @@
            launcher:minHeightDps="567"
            launcher:iconImageSize="54"
            launcher:iconTextSize="13.0"
            launcher:allAppsBorderSpace="16"
            launcher:allAppsCellHeight="104"
            launcher:canBeDefault="true" />

        <display-option
@@ -95,6 +107,8 @@
            launcher:minHeightDps="567"
            launcher:iconImageSize="54"
            launcher:iconTextSize="13.0"
            launcher:allAppsBorderSpace="16"
            launcher:allAppsCellHeight="104"
            launcher:canBeDefault="true" />

    </grid-option>
@@ -116,6 +130,8 @@
            launcher:minHeightDps="694"
            launcher:iconImageSize="56"
            launcher:iconTextSize="14.4"
            launcher:allAppsBorderSpace="16"
            launcher:allAppsCellHeight="104"
            launcher:canBeDefault="true" />

        <display-option
@@ -124,6 +140,8 @@
            launcher:minHeightDps="694"
            launcher:iconImageSize="56"
            launcher:iconTextSize="14.4"
            launcher:allAppsBorderSpace="16"
            launcher:allAppsCellHeight="104"
            launcher:canBeDefault="true" />

        <display-option
@@ -132,6 +150,8 @@
            launcher:minHeightDps="400"
            launcher:iconImageSize="48"
            launcher:iconTextSize="13.0"
            launcher:allAppsBorderSpace="16"
            launcher:allAppsCellHeight="104"
            launcher:canBeDefault="true" />

    </grid-option>
+14 −17
Original line number Diff line number Diff line
@@ -255,7 +255,6 @@ public class DeviceProfile {
        mInsets.set(windowBounds.insets);

        isScalableGrid = inv.isScalable && !isVerticalBarLayout() && !isMultiWindowMode;

        // Determine device posture.
        mInfo = info;
        isTablet = info.isTablet(windowBounds);
@@ -313,7 +312,6 @@ public class DeviceProfile {
        allAppsShiftRange = isTablet
                ? heightPx - allAppsTopPadding
                : res.getDimensionPixelSize(R.dimen.all_apps_starting_vertical_translate);

        folderLabelTextScale = res.getFloat(R.dimen.folder_label_text_scale);
        folderContentPaddingLeftRight =
                res.getDimensionPixelSize(R.dimen.folder_content_padding_left_right);
@@ -795,12 +793,6 @@ public class DeviceProfile {
        allAppsBorderSpacePx = new Point(
                pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].x, mMetrics, scale),
                pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].y, mMetrics, scale));
        if (isScalableGrid) {
            allAppsIconSizePx =
                    pxFromDp(inv.allAppsIconSize[mTypeIndex], mMetrics);
            allAppsIconTextSizePx =
                    pxFromSp(inv.allAppsIconTextSize[mTypeIndex], mMetrics);
            allAppsIconDrawablePaddingPx = iconDrawablePaddingOriginalPx;
        // AllApps cells don't have real space between cells,
        // so we add the border space to the cell height
        allAppsCellHeightPx = pxFromDp(inv.allAppsCellSize[mTypeIndex].y, mMetrics, scale)
@@ -808,14 +800,19 @@ public class DeviceProfile {
        // but width is just the cell,
        // the border is added in #updateAllAppsContainerWidth
        allAppsCellWidthPx = pxFromDp(inv.allAppsCellSize[mTypeIndex].x, mMetrics, scale);
        if (isScalableGrid) {
            allAppsIconSizePx =
                    pxFromDp(inv.allAppsIconSize[mTypeIndex], mMetrics);
            allAppsIconTextSizePx =
                    pxFromSp(inv.allAppsIconTextSize[mTypeIndex], mMetrics);
            allAppsIconDrawablePaddingPx = iconDrawablePaddingOriginalPx;
        } else {
            float invIconSizeDp = inv.iconSize[mTypeIndex];
            float invIconTextSizeSp = inv.iconTextSize[mTypeIndex];
            float invIconSizeDp = inv.allAppsIconSize[mTypeIndex];
            float invIconTextSizeSp = inv.allAppsIconTextSize[mTypeIndex];
            allAppsIconSizePx = Math.max(1, pxFromDp(invIconSizeDp, mMetrics, scale));
            allAppsIconTextSizePx = (int) (pxFromSp(invIconTextSizeSp, mMetrics) * scale);
            allAppsIconDrawablePaddingPx = (int) (iconDrawablePaddingOriginalPx * scale);
            allAppsCellWidthPx = allAppsIconSizePx + (2 * allAppsIconDrawablePaddingPx);
            allAppsCellHeightPx = getCellSize().y;
            allAppsIconDrawablePaddingPx =
                    res.getDimensionPixelSize(R.dimen.all_apps_icon_drawable_padding);
        }

        updateAllAppsContainerWidth(res);