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
This commit is contained in:
Michal Brzezinski
2021-05-17 19:21:37 +01:00
parent 9b60ca5d02
commit 46ecdfe729
2 changed files with 4 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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);
}
}