Update all apps divider to pill shape
Screenshot: https://screenshot.googleplex.com/4AJFL7MjJuZr7tf
Bug: 188946089
Test: local
Change-Id: If45512b24caefc66725892ab8429afd3d9ce20c8
diff --git a/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java b/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java
index d17a5ae..63a569a 100644
--- a/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java
+++ b/quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java
@@ -74,6 +74,8 @@
private boolean mIsScrolledOut = false;
+ private final int[] mDividerSize;
+
public AppsDividerView(Context context) {
this(context, null);
}
@@ -87,8 +89,10 @@
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 @@
@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;
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 06bdd49..f0cc64e 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -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. -->