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:
committed by
Android (Google) Code Review
commit
4bbe3764ff
@@ -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
|
// right and left padding applied to this view to account for cutouts and rounded corners
|
||||||
private Pair<Integer, Integer> mPadding = new Pair(0, 0);
|
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) {
|
public KeyguardStatusBarView(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
mUserManager = UserManager.get(getContext());
|
mUserManager = UserManager.get(getContext());
|
||||||
@@ -549,4 +555,25 @@ public class KeyguardStatusBarView extends RelativeLayout implements
|
|||||||
public void onSystemChromeAnimationUpdate(ValueAnimator anim) {
|
public void onSystemChromeAnimationUpdate(ValueAnimator anim) {
|
||||||
mSystemIconsContainer.setAlpha((float) anim.getAnimatedValue());
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2266,19 +2266,24 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
boolean visible) {
|
boolean visible) {
|
||||||
// Fancy clipping for quick settings
|
// Fancy clipping for quick settings
|
||||||
int radius = mScrimCornerRadius;
|
int radius = mScrimCornerRadius;
|
||||||
|
int statusBarClipTop = 0;
|
||||||
|
boolean clipStatusView = false;
|
||||||
if (!mShouldUseSplitNotificationShade) {
|
if (!mShouldUseSplitNotificationShade) {
|
||||||
// The padding on this area is large enough that we can use a cheaper clipping strategy
|
// The padding on this area is large enough that we can use a cheaper clipping strategy
|
||||||
mKeyguardStatusAreaClipBounds.set(left, top, right, bottom);
|
mKeyguardStatusAreaClipBounds.set(left, top, right, bottom);
|
||||||
mKeyguardStatusViewController.setClipBounds(visible
|
clipStatusView = visible;
|
||||||
? mKeyguardStatusAreaClipBounds : null);
|
|
||||||
radius = (int) MathUtils.lerp(mScreenCornerRadius, mScrimCornerRadius,
|
radius = (int) MathUtils.lerp(mScreenCornerRadius, mScrimCornerRadius,
|
||||||
Math.min(top / (float) mScrimCornerRadius, 1f));
|
Math.min(top / (float) mScrimCornerRadius, 1f));
|
||||||
|
statusBarClipTop = top - mKeyguardStatusBar.getTop();
|
||||||
}
|
}
|
||||||
if (mQs != null) {
|
if (mQs != null) {
|
||||||
mQs.setFancyClipping(top, bottom, radius, visible);
|
mQs.setFancyClipping(top, bottom, radius, visible);
|
||||||
}
|
}
|
||||||
|
mKeyguardStatusViewController.setClipBounds(
|
||||||
|
clipStatusView ? mKeyguardStatusAreaClipBounds : null);
|
||||||
mScrimController.setNotificationsBounds(left, top, right, bottom);
|
mScrimController.setNotificationsBounds(left, top, right, bottom);
|
||||||
mScrimController.setScrimCornerRadius(radius);
|
mScrimController.setScrimCornerRadius(radius);
|
||||||
|
mKeyguardStatusBar.setTopClipping(statusBarClipTop);
|
||||||
}
|
}
|
||||||
|
|
||||||
private float getQSEdgePosition() {
|
private float getQSEdgePosition() {
|
||||||
|
|||||||
Reference in New Issue
Block a user