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

Commit 3dd0f12c authored by Brandon Dayauon's avatar Brandon Dayauon
Browse files

Increase predicted app row by 4dp to be same as SEARCH_RESULT_APP_ROW

Verified that there should be no jumping going on in the top app row between A-Z list and Toast.

bug: 312781931
Test: manual -video:
https://drive.google.com/file/d/11GX-5mVr5BoZY29IyX5FvrIA_yT57MOJ/view?usp=sharing
Flag: None

Change-Id: I5c35c04eb500f52780b0b77c542e0a861346a3fd
parent 60dcb19a
Loading
Loading
Loading
Loading
+14 −7
Original line number Original line Diff line number Diff line
@@ -56,6 +56,11 @@ public class PredictionRowView<T extends Context & ActivityContext>


    private final T mActivityContext;
    private final T mActivityContext;
    private int mNumPredictedAppsPerRow;
    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.
    // Helper to drawing the focus indicator.
    private final FocusIndicatorHelper mFocusHelper;
    private final FocusIndicatorHelper mFocusHelper;
@@ -78,6 +83,10 @@ public class PredictionRowView<T extends Context & ActivityContext>
        mFocusHelper = new SimpleFocusIndicatorHelper(this);
        mFocusHelper = new SimpleFocusIndicatorHelper(this);
        mActivityContext = ActivityContext.lookupContext(context);
        mActivityContext = ActivityContext.lookupContext(context);
        mNumPredictedAppsPerRow = mActivityContext.getDeviceProfile().numShownAllAppsColumns;
        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();
        updateVisibility();
    }
    }


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


+1 −0
Original line number Original line 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_content_overlap">24dp</dimen>
    <dimen name="all_apps_search_bar_bottom_padding">30dp</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_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_height">48dp</dimen>
    <dimen name="all_apps_header_pill_corner_radius">12dp</dimen>
    <dimen name="all_apps_header_pill_corner_radius">12dp</dimen>
    <dimen name="all_apps_header_tab_height">48dp</dimen>
    <dimen name="all_apps_header_tab_height">48dp</dimen>