From 46ecdfe7297aeb99c45e8c1b12c0e1a33eebcb15 Mon Sep 17 00:00:00 2001 From: Michal Brzezinski Date: Mon, 17 May 2021 19:21:37 +0100 Subject: [PATCH] Fixing notification shade scrims aliasing issue Extending notification scrim 1 pixel higher to overlap with behind scrim which diminishes aliasing effect. Bug: 186644628 Test: manual + ScrimControllerTest Change-Id: Id94ddce26ffde5f7bc8dc9ea300c3f101cfffd6d --- .../SystemUI/src/com/android/systemui/scrim/ScrimView.java | 1 - .../android/systemui/statusbar/phone/ScrimController.java | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/scrim/ScrimView.java b/packages/SystemUI/src/com/android/systemui/scrim/ScrimView.java index 1a5c9ee25b479..7530681c82b2d 100644 --- a/packages/SystemUI/src/com/android/systemui/scrim/ScrimView.java +++ b/packages/SystemUI/src/com/android/systemui/scrim/ScrimView.java @@ -294,7 +294,6 @@ public class ScrimView extends View { /** * Make bottom edge concave so overlap between layers is not visible for alphas between 0 and 1 - * @return height of concavity */ public void enableBottomEdgeConcave(boolean clipScrim) { if (mDrawable instanceof ScrimDrawable) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java index bbde3c3e31447..b94b5d3c7e2bc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java @@ -547,9 +547,12 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump * Set bounds for notifications background, all coordinates are absolute */ public void setNotificationsBounds(float left, float top, float right, float bottom) { - mNotificationsScrim.setDrawableBounds(left, top, right, bottom); if (mClipsQsScrim) { + // "top - 1" to have 1 px of scrims overlap, see: b/186644628 + mNotificationsScrim.setDrawableBounds(left, top - 1, right, bottom); mScrimBehind.setBottomEdgePosition((int) top); + } else { + mNotificationsScrim.setDrawableBounds(left, top, right, bottom); } }