lineage_patches_unified/patches_platform/frameworks_base/0028-SystemUI-Switch-notification-background-to-monet-on-.patch

93 lines
4.2 KiB
Diff

From ee07d3b1026400a4aac3743d8fb6feff5242c5ac Mon Sep 17 00:00:00 2001
From: DillerOFire <niktofe1@gmail.com>
Date: Wed, 27 Jul 2022 15:28:16 +1000
Subject: [PATCH 28/31] SystemUI: Switch notification background to monet on
heads up
Change-Id: If1822acc3ea604444f2083d7fadec06ffb8eec19
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
---
.../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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2014 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License
+ -->
+
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
+ android:color="?android:attr/colorControlHighlight">
+ <item>
+ <shape>
+ <solid android:color="?androidprv:attr/colorSurface" />
+ </shape>
+ </item>
+</ripple>
\ 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 1b790fdc35c1..e958cbf452db 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
@@ -168,7 +168,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() {
@@ -179,6 +179,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 d92d11b18d74..ce9eac753550 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
@@ -1047,6 +1047,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
if (intrinsicHeight != getIntrinsicHeight()) {
notifyHeightChanged(false /* needsAnimation */);
}
+
+ setTranslucentBackground(!pinned);
+
if (pinned) {
setAnimationRunning(true);
mExpandedWhenPinned = false;
--
2.34.1