From 01397a7825bba7e536dab2788e9658fbb4c22aad Mon Sep 17 00:00:00 2001 From: Johannes Gallmann Date: Mon, 10 Oct 2022 10:19:39 +0000 Subject: [PATCH] Fix notification group dismissal fade animation When dismissing a notification group, only the content should be faded but not the background. Test: Manual, i.e. posting a Standard notification and an Inbox notification from the Notify2-RVC App (as well as the Notify2-SC app), then dismissing both notifications together by swiping the group header. Bug: 202138492 Change-Id: If7c9eb99ee6a67566b77520c69138e0d5b543381 --- .../row/ExpandableNotificationRow.java | 2 +- .../stack/NotificationChildrenContainer.java | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) 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 07ed0135bf6e3..74cc58c91f515 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 @@ -1487,7 +1487,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView l.setAlpha(alpha); } if (mChildrenContainer != null) { - mChildrenContainer.setAlpha(alpha); + mChildrenContainer.setContentAlpha(alpha); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java index d77e03fd043d9..4ba22d08eef28 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java @@ -461,6 +461,20 @@ public class NotificationChildrenContainer extends ViewGroup return mAttachedChildren; } + /** + * Sets the alpha on the content, while leaving the background of the container itself as is. + * + * @param alpha alpha value to apply to the content + */ + public void setContentAlpha(float alpha) { + for (int i = 0; i < mNotificationHeader.getChildCount(); i++) { + mNotificationHeader.getChildAt(i).setAlpha(alpha); + } + for (ExpandableNotificationRow child : getAttachedChildren()) { + child.setContentAlpha(alpha); + } + } + /** To be called any time the rows have been updated */ public void updateExpansionStates() { if (mChildrenExpanded || mUserLocked) {