From a0859487e4580c100bbea2ecc8d5944ecaa4ec5a Mon Sep 17 00:00:00 2001 From: Jay Aliomer Date: Thu, 17 Jun 2021 23:27:08 -0400 Subject: [PATCH] Dim background when group notification expanded This fixes the contrast issue when dismissing Fixes: 187652080 Test: visual Change-Id: Ic181bc8b23ae62c8212fee19fd7c6434eb94cd61 --- .../notification/row/ActivatableNotificationView.java | 8 ++++++++ .../notification/row/ExpandableNotificationRow.java | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java index c24c2be3faa3b..4f3406c405add 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java @@ -203,6 +203,14 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView mBackgroundNormal.setCustomBackground(R.drawable.notification_material_bg); } + protected boolean hideBackground() { + return false; + } + + protected void updateBackground() { + mBackgroundNormal.setVisibility(hideBackground() ? INVISIBLE : VISIBLE); + } + @Override public boolean onInterceptTouchEvent(MotionEvent ev) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index ba28dc59def4e..9d56e9b6f855a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -2890,6 +2890,12 @@ public class ExpandableNotificationRow extends ActivatableNotificationView mShowNoBackground = false; } updateOutline(); + updateBackground(); + } + + @Override + protected boolean hideBackground() { + return mShowNoBackground || super.hideBackground(); } public int getPositionOfChild(ExpandableNotificationRow childRow) {