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

Commit 4ff26827 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update all apps divider to pill shape" into sc-dev

parents 1bd6fdb6 d85735db
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -74,6 +74,8 @@ public class AppsDividerView extends View implements StateListener<LauncherState

    private boolean mIsScrolledOut = false;

    private final int[] mDividerSize;

    public AppsDividerView(Context context) {
        this(context, null);
    }
@@ -87,8 +89,10 @@ public class AppsDividerView extends View implements StateListener<LauncherState
        mLauncher = Launcher.getLauncher(context);

        boolean isMainColorDark = Themes.getAttrBoolean(context, R.attr.isMainColorDark);
        mPaint.setStrokeWidth(
                getResources().getDimensionPixelSize(R.dimen.all_apps_divider_height));
        mDividerSize = new int[]{
                getResources().getDimensionPixelSize(R.dimen.all_apps_divider_width),
                getResources().getDimensionPixelSize(R.dimen.all_apps_divider_height)
        };

        mStrokeColor = ContextCompat.getColor(context, isMainColorDark
                ? R.color.all_apps_prediction_row_separator_dark
@@ -187,11 +191,11 @@ public class AppsDividerView extends View implements StateListener<LauncherState
    @Override
    protected void onDraw(Canvas canvas) {
        if (mDividerType == DividerType.LINE) {
            int side = getResources().getDimensionPixelSize(R.dimen.dynamic_grid_edge_margin);
            int y = getHeight() - (getPaddingBottom() / 2);
            int x1 = getPaddingLeft() + side;
            int x2 = getWidth() - getPaddingRight() - side;
            canvas.drawLine(x1, y, x2, y, mPaint);
            int l = (getWidth() - getPaddingLeft() - mDividerSize[0]) / 2;
            int t = getHeight() - (getPaddingBottom() / 2);
            int radius = mDividerSize[1];
            canvas.drawRoundRect(l, t, l + mDividerSize[0], t + mDividerSize[1], radius, radius,
                    mPaint);
        } else if (mDividerType == DividerType.ALL_APPS_LABEL) {
            Layout textLayout = getAllAppsLabelLayout();
            int x = getWidth() / 2 - textLayout.getWidth() / 2;
+2 −1
Original line number Diff line number Diff line
@@ -102,7 +102,8 @@
    <dimen name="all_apps_work_profile_tab_footer_top_padding">16dp</dimen>
    <dimen name="all_apps_work_profile_tab_footer_bottom_padding">20dp</dimen>
    <dimen name="all_apps_tabs_vertical_padding">6dp</dimen>
    <dimen name="all_apps_divider_height">1dp</dimen>
    <dimen name="all_apps_divider_height">2dp</dimen>
    <dimen name="all_apps_divider_width">128dp</dimen>

    <dimen name="all_apps_tip_bottom_margin">8dp</dimen>
    <!-- The size of corner radius of the arrow in the arrow toast. -->