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

Commit 4f673d25 authored by Brandon Dayauon's avatar Brandon Dayauon Committed by Android (Google) Code Review
Browse files

Merge "Increase predicted app row by 4dp to be same as SEARCH_RESULT_APP_ROW" into main

parents ad51bc1d 3dd0f12c
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -56,6 +56,11 @@ public class PredictionRowView<T extends Context & ActivityContext>

    private final T mActivityContext;
    private int mNumPredictedAppsPerRow;
    // Vertical padding of the icon that contributes to the expected cell height.
    private final int mVerticalPadding;
    // Extra padding that is used in the top app rows (prediction and search) that is not used in
    // the regular A-Z list. This only applies to single line label.
    private final int mTopRowExtraHeight;

    // Helper to drawing the focus indicator.
    private final FocusIndicatorHelper mFocusHelper;
@@ -78,6 +83,10 @@ public class PredictionRowView<T extends Context & ActivityContext>
        mFocusHelper = new SimpleFocusIndicatorHelper(this);
        mActivityContext = ActivityContext.lookupContext(context);
        mNumPredictedAppsPerRow = mActivityContext.getDeviceProfile().numShownAllAppsColumns;
        mTopRowExtraHeight = getResources().getDimensionPixelSize(
                R.dimen.all_apps_search_top_row_extra_height);
        mVerticalPadding = getResources().getDimensionPixelSize(
                R.dimen.all_apps_predicted_icon_vertical_padding);
        updateVisibility();
    }

@@ -126,13 +135,11 @@ public class PredictionRowView<T extends Context & ActivityContext>
        int iconHeight = deviceProfile.allAppsIconSizePx;
        int iconPadding = deviceProfile.allAppsIconDrawablePaddingPx;
        int textHeight = Utilities.calculateTextHeight(deviceProfile.allAppsIconTextSizePx);
        int verticalPadding = getResources().getDimensionPixelSize(
                R.dimen.all_apps_predicted_icon_vertical_padding);
        int totalHeight = iconHeight + iconPadding + textHeight + verticalPadding * 2;
        if (FeatureFlags.enableTwolineAllapps()) {
            // Add extra textHeight to the existing total height.
            totalHeight += textHeight;
        }
        int totalHeight = iconHeight + iconPadding + textHeight + mVerticalPadding * 2;
        // Prediction row height will be 4dp bigger than the regular apps in A-Z list when two line
        // is not enabled. Otherwise, the extra height will increase by just the textHeight.
        int extraHeight = FeatureFlags.enableTwolineAllapps() ? textHeight : mTopRowExtraHeight;
        totalHeight += extraHeight;
        return getVisibility() == GONE ? 0 : totalHeight + getPaddingTop() + getPaddingBottom();
    }

+1 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@
    <dimen name="all_apps_search_bar_content_overlap">24dp</dimen>
    <dimen name="all_apps_search_bar_bottom_padding">30dp</dimen>
    <dimen name="all_apps_empty_search_message_top_offset">40dp</dimen>
    <dimen name="all_apps_search_top_row_extra_height">4dp</dimen>
    <dimen name="all_apps_header_pill_height">48dp</dimen>
    <dimen name="all_apps_header_pill_corner_radius">12dp</dimen>
    <dimen name="all_apps_header_tab_height">48dp</dimen>