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

Commit 369c6e8b authored by Andy Wickham's avatar Andy Wickham
Browse files

Reduces vertical padding of predicted apps in All Apps.

Rather than using the full allAppsCellHeight, manually construct
the icon + padding + text and add custom padding (8dp).

Screenshots: https://drive.google.com/drive/folders/1hgEE72PaTj60SxgfPUzQ8hGwnCOWx-Lp?resourcekey=0-TgrHKITyzIXmNAAMYpA_MA&usp=sharing

Fix: 242915342
Test: Manual inspection
Change-Id: Ic566e0f7ea7cf486054bb8fe2429ee5c53e8b174
parent d581f40b
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DeviceProfile.DeviceProfileListenable;
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.allapps.FloatingHeaderRow;
import com.android.launcher3.allapps.FloatingHeaderView;
import com.android.launcher3.anim.AlphaUpdateListener;
@@ -117,9 +118,14 @@ public class PredictionRowView<T extends Context & ActivityContext & DeviceProfi

    @Override
    public int getExpectedHeight() {
        return getVisibility() == GONE ? 0
                : mActivityContext.getDeviceProfile().allAppsCellHeightPx + getPaddingTop()
                        + getPaddingBottom();
        DeviceProfile deviceProfile = mActivityContext.getDeviceProfile();
        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;
        return getVisibility() == GONE ? 0 : totalHeight + getPaddingTop() + getPaddingBottom();
    }

    @Override
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
    android:layout_gravity="center_horizontal"
    android:paddingTop="@dimen/all_apps_tabs_vertical_padding"
    android:paddingBottom="@dimen/all_apps_tabs_vertical_padding"
    android:layout_marginTop="@dimen/all_apps_tabs_margin_top"
    android:orientation="horizontal"
    style="@style/TextHeadline">

+2 −1
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@
    <dimen name="all_apps_work_profile_tab_footer_bottom_padding">20dp</dimen>
    <dimen name="all_apps_tabs_button_horizontal_padding">4dp</dimen>
    <dimen name="all_apps_tabs_vertical_padding">6dp</dimen>
    <dimen name="all_apps_tabs_margin_top">8dp</dimen>
    <dimen name="all_apps_divider_height">2dp</dimen>
    <dimen name="all_apps_divider_width">128dp</dimen>
    <dimen name="all_apps_content_fade_in_offset">150dp</dimen>
@@ -128,9 +129,9 @@
    <dimen name="all_apps_height_extra">6dp</dimen>
    <dimen name="all_apps_bottom_sheet_horizontal_padding">0dp</dimen>
    <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>
    <dimen name="all_apps_predicted_icon_vertical_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>
+2 −1
Original line number Diff line number Diff line
@@ -272,7 +272,8 @@ public class FloatingHeaderView extends LinearLayout implements
        }
        mMaxTranslation += mFloatingRowsHeight;
        if (!mTabsHidden) {
            mMaxTranslation += mTabsAdditionalPaddingBottom;
            mMaxTranslation += mTabsAdditionalPaddingBottom
                    + getResources().getDimensionPixelSize(R.dimen.all_apps_tabs_margin_top);
        }
    }

+6 −2
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.view.animation.Interpolator;
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.R;

/** Coordinates the transition between Search and A-Z in All Apps. */
public class SearchTransitionController {
@@ -144,8 +145,11 @@ public class SearchTransitionController {
            headerView.setAlpha(clampToProgress(searchToAzProgress, 0.8f, 1f));

            // Account for the additional padding added for the tabs.
            appsTranslationY -=
                    headerView.getPaddingTop() - headerView.getTabsAdditionalPaddingBottom();
            appsTranslationY +=
                    headerView.getTabsAdditionalPaddingBottom()
                            + mAllAppsContainerView.getResources().getDimensionPixelOffset(
                                    R.dimen.all_apps_tabs_margin_top)
                            - headerView.getPaddingTop();
        }

        View appsContainer = mAllAppsContainerView.getAppsRecyclerViewContainer();