Merge "Remove scrim from navigation bar from full widget picker." into sc-dev

This commit is contained in:
Alina Zaidi 2021-06-26 18:01:23 +00:00 committed by Android (Google) Code Review
commit 57cdcceb07
2 changed files with 0 additions and 21 deletions

View File

@ -17,12 +17,10 @@ package com.android.launcher3.views;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.AttributeSet;
import com.android.launcher3.R;
import com.android.launcher3.util.Themes;
/**
@ -34,41 +32,23 @@ public class TopRoundedCornerView extends SpringRelativeLayout {
private final Path mClipPath = new Path();
private float[] mRadii;
private final Paint mNavBarScrimPaint;
private int mNavBarScrimHeight = 0;
public TopRoundedCornerView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
float radius = Themes.getDialogCornerRadius(context);
mRadii = new float[] {radius, radius, radius, radius, 0, 0, 0, 0};
mNavBarScrimPaint = new Paint();
mNavBarScrimPaint.setColor(Themes.getAttrColor(context, R.attr.allAppsNavBarScrimColor));
}
public TopRoundedCornerView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public void setNavBarScrimHeight(int height) {
if (mNavBarScrimHeight != height) {
mNavBarScrimHeight = height;
invalidate();
}
}
@Override
public void draw(Canvas canvas) {
canvas.save();
canvas.clipPath(mClipPath);
super.draw(canvas);
canvas.restore();
if (mNavBarScrimHeight > 0) {
canvas.drawRect(0, getHeight() - mNavBarScrimHeight, getWidth(), getHeight(),
mNavBarScrimPaint);
}
}
@Override

View File

@ -323,7 +323,6 @@ public class WidgetsFullSheet extends BaseWidgetSheet
clearNavBarColor();
}
((TopRoundedCornerView) mContent).setNavBarScrimHeight(mInsets.bottom);
requestLayout();
}