Merge "Fix heads-up notification clipping in split shade" into tm-qpr-dev am: d2cb23038f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19931457 Change-Id: I9fada57579f7e5aff064ed9c6ff2a9455b8c2a5a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -3041,11 +3041,23 @@ public final class NotificationPanelViewController {
|
|||||||
// relative to NotificationStackScrollLayout
|
// relative to NotificationStackScrollLayout
|
||||||
int nsslLeft = left - mNotificationStackScrollLayoutController.getLeft();
|
int nsslLeft = left - mNotificationStackScrollLayoutController.getLeft();
|
||||||
int nsslRight = right - mNotificationStackScrollLayoutController.getLeft();
|
int nsslRight = right - mNotificationStackScrollLayoutController.getLeft();
|
||||||
int nsslTop = top - mNotificationStackScrollLayoutController.getTop();
|
int nsslTop = getNotificationsClippingTopBounds(top);
|
||||||
int nsslBottom = bottom - mNotificationStackScrollLayoutController.getTop();
|
int nsslBottom = bottom - mNotificationStackScrollLayoutController.getTop();
|
||||||
int bottomRadius = mSplitShadeEnabled ? radius : 0;
|
int bottomRadius = mSplitShadeEnabled ? radius : 0;
|
||||||
|
int topRadius = mSplitShadeEnabled && mExpandingFromHeadsUp ? 0 : radius;
|
||||||
mNotificationStackScrollLayoutController.setRoundedClippingBounds(
|
mNotificationStackScrollLayoutController.setRoundedClippingBounds(
|
||||||
nsslLeft, nsslTop, nsslRight, nsslBottom, radius, bottomRadius);
|
nsslLeft, nsslTop, nsslRight, nsslBottom, topRadius, bottomRadius);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getNotificationsClippingTopBounds(int qsTop) {
|
||||||
|
if (mSplitShadeEnabled && mExpandingFromHeadsUp) {
|
||||||
|
// in split shade nssl has extra top margin so clipping at top 0 is not enough, we need
|
||||||
|
// to set top clipping bound to negative value to allow HUN to go up to the top edge of
|
||||||
|
// the screen without clipping.
|
||||||
|
return -mAmbientState.getStackTopMargin();
|
||||||
|
} else {
|
||||||
|
return qsTop - mNotificationStackScrollLayoutController.getTop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private float getQSEdgePosition() {
|
private float getQSEdgePosition() {
|
||||||
|
|||||||
@@ -1383,7 +1383,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
|
|||||||
if (height < minExpansionHeight) {
|
if (height < minExpansionHeight) {
|
||||||
mClipRect.left = 0;
|
mClipRect.left = 0;
|
||||||
mClipRect.right = getWidth();
|
mClipRect.right = getWidth();
|
||||||
mClipRect.top = 0;
|
mClipRect.top = getNotificationsClippingTopBound();
|
||||||
mClipRect.bottom = (int) height;
|
mClipRect.bottom = (int) height;
|
||||||
height = minExpansionHeight;
|
height = minExpansionHeight;
|
||||||
setRequestedClipBounds(mClipRect);
|
setRequestedClipBounds(mClipRect);
|
||||||
@@ -1444,6 +1444,17 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
|
|||||||
notifyAppearChangedListeners();
|
notifyAppearChangedListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getNotificationsClippingTopBound() {
|
||||||
|
if (isHeadsUpTransition()) {
|
||||||
|
// HUN in split shade can go higher than bottom of NSSL when swiping up so we want
|
||||||
|
// to give it extra clipping margin. Because clipping has rounded corners, we also
|
||||||
|
// need to account for that corner clipping.
|
||||||
|
return -mAmbientState.getStackTopMargin() - mCornerRadius;
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void notifyAppearChangedListeners() {
|
private void notifyAppearChangedListeners() {
|
||||||
float appear;
|
float appear;
|
||||||
float expandAmount;
|
float expandAmount;
|
||||||
@@ -1482,7 +1493,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
|
|||||||
public void updateClipping() {
|
public void updateClipping() {
|
||||||
boolean clipped = mRequestedClipBounds != null && !mInHeadsUpPinnedMode
|
boolean clipped = mRequestedClipBounds != null && !mInHeadsUpPinnedMode
|
||||||
&& !mHeadsUpAnimatingAway;
|
&& !mHeadsUpAnimatingAway;
|
||||||
boolean clipToOutline = false;
|
|
||||||
if (mIsClipped != clipped) {
|
if (mIsClipped != clipped) {
|
||||||
mIsClipped = clipped;
|
mIsClipped = clipped;
|
||||||
}
|
}
|
||||||
@@ -1498,7 +1508,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
|
|||||||
setClipBounds(null);
|
setClipBounds(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
setClipToOutline(clipToOutline);
|
setClipToOutline(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user