Merge changes I9d77c818,I13ad2788 into sc-dev

* changes:
  Fixed an issue where the statusview could become clipped
  Fixed the clipping of the keyguard status bar during drag down
This commit is contained in:
TreeHugger Robot
2021-05-26 23:21:00 +00:00
committed by Android (Google) Code Review
2 changed files with 34 additions and 2 deletions

View File

@@ -116,6 +116,12 @@ public class KeyguardStatusBarView extends RelativeLayout implements
// right and left padding applied to this view to account for cutouts and rounded corners
private Pair<Integer, Integer> mPadding = new Pair(0, 0);
/**
* The clipping on the top
*/
private int mTopClipping;
private final Rect mClipRect = new Rect(0, 0, 0, 0);
public KeyguardStatusBarView(Context context, AttributeSet attrs) {
super(context, attrs);
mUserManager = UserManager.get(getContext());
@@ -549,4 +555,25 @@ public class KeyguardStatusBarView extends RelativeLayout implements
public void onSystemChromeAnimationUpdate(ValueAnimator anim) {
mSystemIconsContainer.setAlpha((float) anim.getAnimatedValue());
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
updateClipping();
}
/**
* Set the clipping on the top of the view.
*/
public void setTopClipping(int topClipping) {
if (topClipping != mTopClipping) {
mTopClipping = topClipping;
updateClipping();
}
}
private void updateClipping() {
mClipRect.set(0, mTopClipping, getWidth(), getHeight());
setClipBounds(mClipRect);
}
}

View File

@@ -2266,19 +2266,24 @@ public class NotificationPanelViewController extends PanelViewController {
boolean visible) {
// Fancy clipping for quick settings
int radius = mScrimCornerRadius;
int statusBarClipTop = 0;
boolean clipStatusView = false;
if (!mShouldUseSplitNotificationShade) {
// The padding on this area is large enough that we can use a cheaper clipping strategy
mKeyguardStatusAreaClipBounds.set(left, top, right, bottom);
mKeyguardStatusViewController.setClipBounds(visible
? mKeyguardStatusAreaClipBounds : null);
clipStatusView = visible;
radius = (int) MathUtils.lerp(mScreenCornerRadius, mScrimCornerRadius,
Math.min(top / (float) mScrimCornerRadius, 1f));
statusBarClipTop = top - mKeyguardStatusBar.getTop();
}
if (mQs != null) {
mQs.setFancyClipping(top, bottom, radius, visible);
}
mKeyguardStatusViewController.setClipBounds(
clipStatusView ? mKeyguardStatusAreaClipBounds : null);
mScrimController.setNotificationsBounds(left, top, right, bottom);
mScrimController.setScrimCornerRadius(radius);
mKeyguardStatusBar.setTopClipping(statusBarClipTop);
}
private float getQSEdgePosition() {