Merge "Fixing notification scrim shifted in landscape orientation" into sc-dev

This commit is contained in:
Michał Brzeziński
2021-05-24 10:14:21 +00:00
committed by Android (Google) Code Review

View File

@@ -372,6 +372,7 @@ public class NotificationPanelViewController extends PanelViewController {
private float mDownX; private float mDownX;
private float mDownY; private float mDownY;
private int mDisplayCutoutTopInset = 0; // in pixels private int mDisplayCutoutTopInset = 0; // in pixels
private int mDisplayCutoutLeftInset = 0; // in pixels
private int mSplitShadeNotificationsTopPadding; private int mSplitShadeNotificationsTopPadding;
private final KeyguardClockPositionAlgorithm private final KeyguardClockPositionAlgorithm
@@ -2174,8 +2175,8 @@ public class NotificationPanelViewController extends PanelViewController {
: notificationTop); : notificationTop);
} }
bottom = getView().getBottom(); bottom = getView().getBottom();
left = getView().getLeft(); left = getView().getLeft() - mDisplayCutoutLeftInset;
right = getView().getRight(); right = getView().getRight() - mDisplayCutoutLeftInset;
} else if (qsPanelBottomY > 0) { // so bounds are empty on lockscreen } else if (qsPanelBottomY > 0) { // so bounds are empty on lockscreen
top = Math.min(qsPanelBottomY, mSplitShadeNotificationsTopPadding); top = Math.min(qsPanelBottomY, mSplitShadeNotificationsTopPadding);
bottom = mNotificationStackScrollLayoutController.getHeight(); bottom = mNotificationStackScrollLayoutController.getHeight();
@@ -4414,6 +4415,7 @@ public class NotificationPanelViewController extends PanelViewController {
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) { public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
final DisplayCutout displayCutout = v.getRootWindowInsets().getDisplayCutout(); final DisplayCutout displayCutout = v.getRootWindowInsets().getDisplayCutout();
mDisplayCutoutTopInset = displayCutout != null ? displayCutout.getSafeInsetTop() : 0; mDisplayCutoutTopInset = displayCutout != null ? displayCutout.getSafeInsetTop() : 0;
mDisplayCutoutLeftInset = displayCutout != null ? displayCutout.getSafeInsetLeft() : 0;
mNavigationBarBottomHeight = insets.getStableInsetBottom(); mNavigationBarBottomHeight = insets.getStableInsetBottom();
updateMaxHeadsUpTranslation(); updateMaxHeadsUpTranslation();