Merge "Split-shade: fix notification scrim position when there is a horizontal display cutout." into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
85c8dd5b12
@@ -450,6 +450,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
private float mDownY;
|
private float mDownY;
|
||||||
private int mDisplayTopInset = 0; // in pixels
|
private int mDisplayTopInset = 0; // in pixels
|
||||||
private int mDisplayRightInset = 0; // in pixels
|
private int mDisplayRightInset = 0; // in pixels
|
||||||
|
private int mDisplayLeftInset = 0; // in pixels
|
||||||
private int mLargeScreenShadeHeaderHeight;
|
private int mLargeScreenShadeHeaderHeight;
|
||||||
private int mSplitShadeNotificationsScrimMarginBottom;
|
private int mSplitShadeNotificationsScrimMarginBottom;
|
||||||
|
|
||||||
@@ -3011,7 +3012,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
// left bounds can ignore insets, it should always reach the edge of the screen
|
// left bounds can ignore insets, it should always reach the edge of the screen
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return mNotificationStackScrollLayoutController.getLeft();
|
return mNotificationStackScrollLayoutController.getLeft() + mDisplayLeftInset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3019,7 +3020,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
if (mIsFullWidth) {
|
if (mIsFullWidth) {
|
||||||
return mView.getRight() + mDisplayRightInset;
|
return mView.getRight() + mDisplayRightInset;
|
||||||
} else {
|
} else {
|
||||||
return mNotificationStackScrollLayoutController.getRight();
|
return mNotificationStackScrollLayoutController.getRight() + mDisplayLeftInset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3143,8 +3144,8 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
|
|
||||||
// Convert global clipping coordinates to local ones,
|
// Convert global clipping coordinates to local ones,
|
||||||
// relative to NotificationStackScrollLayout
|
// relative to NotificationStackScrollLayout
|
||||||
int nsslLeft = left - mNotificationStackScrollLayoutController.getLeft();
|
int nsslLeft = calculateNsslLeft(left);
|
||||||
int nsslRight = right - mNotificationStackScrollLayoutController.getLeft();
|
int nsslRight = calculateNsslRight(right);
|
||||||
int nsslTop = getNotificationsClippingTopBounds(top);
|
int nsslTop = getNotificationsClippingTopBounds(top);
|
||||||
int nsslBottom = bottom - mNotificationStackScrollLayoutController.getTop();
|
int nsslBottom = bottom - mNotificationStackScrollLayoutController.getTop();
|
||||||
int bottomRadius = mSplitShadeEnabled ? radius : 0;
|
int bottomRadius = mSplitShadeEnabled ? radius : 0;
|
||||||
@@ -3153,6 +3154,22 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
nsslLeft, nsslTop, nsslRight, nsslBottom, topRadius, bottomRadius);
|
nsslLeft, nsslTop, nsslRight, nsslBottom, topRadius, bottomRadius);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int calculateNsslLeft(int nsslLeftAbsolute) {
|
||||||
|
int left = nsslLeftAbsolute - mNotificationStackScrollLayoutController.getLeft();
|
||||||
|
if (mIsFullWidth) {
|
||||||
|
return left;
|
||||||
|
}
|
||||||
|
return left - mDisplayLeftInset;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int calculateNsslRight(int nsslRightAbsolute) {
|
||||||
|
int right = nsslRightAbsolute - mNotificationStackScrollLayoutController.getLeft();
|
||||||
|
if (mIsFullWidth) {
|
||||||
|
return right;
|
||||||
|
}
|
||||||
|
return right - mDisplayLeftInset;
|
||||||
|
}
|
||||||
|
|
||||||
private int getNotificationsClippingTopBounds(int qsTop) {
|
private int getNotificationsClippingTopBounds(int qsTop) {
|
||||||
if (mSplitShadeEnabled && mExpandingFromHeadsUp) {
|
if (mSplitShadeEnabled && mExpandingFromHeadsUp) {
|
||||||
// in split shade nssl has extra top margin so clipping at top 0 is not enough, we need
|
// in split shade nssl has extra top margin so clipping at top 0 is not enough, we need
|
||||||
@@ -4550,6 +4567,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
ipw.print("mDownY="); ipw.println(mDownY);
|
ipw.print("mDownY="); ipw.println(mDownY);
|
||||||
ipw.print("mDisplayTopInset="); ipw.println(mDisplayTopInset);
|
ipw.print("mDisplayTopInset="); ipw.println(mDisplayTopInset);
|
||||||
ipw.print("mDisplayRightInset="); ipw.println(mDisplayRightInset);
|
ipw.print("mDisplayRightInset="); ipw.println(mDisplayRightInset);
|
||||||
|
ipw.print("mDisplayLeftInset="); ipw.println(mDisplayLeftInset);
|
||||||
ipw.print("mLargeScreenShadeHeaderHeight="); ipw.println(mLargeScreenShadeHeaderHeight);
|
ipw.print("mLargeScreenShadeHeaderHeight="); ipw.println(mLargeScreenShadeHeaderHeight);
|
||||||
ipw.print("mSplitShadeNotificationsScrimMarginBottom=");
|
ipw.print("mSplitShadeNotificationsScrimMarginBottom=");
|
||||||
ipw.println(mSplitShadeNotificationsScrimMarginBottom);
|
ipw.println(mSplitShadeNotificationsScrimMarginBottom);
|
||||||
@@ -5927,6 +5945,7 @@ public final class NotificationPanelViewController implements Dumpable {
|
|||||||
Insets combinedInsets = insets.getInsetsIgnoringVisibility(insetTypes);
|
Insets combinedInsets = insets.getInsetsIgnoringVisibility(insetTypes);
|
||||||
mDisplayTopInset = combinedInsets.top;
|
mDisplayTopInset = combinedInsets.top;
|
||||||
mDisplayRightInset = combinedInsets.right;
|
mDisplayRightInset = combinedInsets.right;
|
||||||
|
mDisplayLeftInset = combinedInsets.left;
|
||||||
|
|
||||||
mNavigationBarBottomHeight = insets.getStableInsetBottom();
|
mNavigationBarBottomHeight = insets.getStableInsetBottom();
|
||||||
updateMaxHeadsUpTranslation();
|
updateMaxHeadsUpTranslation();
|
||||||
|
|||||||
Reference in New Issue
Block a user