93 lines
4.2 KiB
Diff
93 lines
4.2 KiB
Diff
From b983f9062624d76c6cf6a66eee0851bb99e83c3d Mon Sep 17 00:00:00 2001
|
|
From: DillerOFire <niktofe1@gmail.com>
|
|
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 <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 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
|
|
|