mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Merge "Update all apps divider to pill shape" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4ff2682787
@@ -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;
|
||||
|
||||
@@ -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. -->
|
||||
|
||||
Reference in New Issue
Block a user