From b983f9062624d76c6cf6a66eee0851bb99e83c3d Mon Sep 17 00:00:00 2001 From: DillerOFire Date: Wed, 27 Jul 2022 15:28:16 +1000 Subject: [PATCH 31/34] SystemUI: Switch notification background to monet on heads up Change-Id: If1822acc3ea604444f2083d7fadec06ffb8eec19 Signed-off-by: Pranav Vashi --- .../notification_material_bg_monet.xml | 26 +++++++++++++++++++ .../row/ActivatableNotificationView.java | 9 ++++++- .../row/ExpandableNotificationRow.java | 3 +++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 packages/SystemUI/res/drawable/notification_material_bg_monet.xml diff --git a/packages/SystemUI/res/drawable/notification_material_bg_monet.xml b/packages/SystemUI/res/drawable/notification_material_bg_monet.xml new file mode 100644 index 000000000000..61a8e8e9c6e1 --- /dev/null +++ b/packages/SystemUI/res/drawable/notification_material_bg_monet.xml @@ -0,0 +1,26 @@ + + + + + + + + + + \ No newline at end of file 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 9fa9049cc7cd..dc04895508d0 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 @@ -171,7 +171,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView * be useful in a configuration change. */ protected void initBackground() { - mBackgroundNormal.setCustomBackground(R.drawable.notification_material_bg); + setTranslucentBackground(true); } protected boolean hideBackground() { @@ -182,6 +182,13 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView mBackgroundNormal.setVisibility(hideBackground() ? INVISIBLE : VISIBLE); } + public void setTranslucentBackground(boolean translucent) { + if (translucent) { + mBackgroundNormal.setCustomBackground(R.drawable.notification_material_bg); + } else { + mBackgroundNormal.setCustomBackground(R.drawable.notification_material_bg_monet); + } + } @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 b6d4dedfe6f7..2ea46cae819f 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 @@ -1041,6 +1041,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView if (intrinsicHeight != getIntrinsicHeight()) { notifyHeightChanged(false /* needsAnimation */); } + + setTranslucentBackground(!pinned); + if (pinned) { setAnimationRunning(true); mExpandedWhenPinned = false; -- 2.34.1