summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ioana Alexandru <aioana@google.com> 2024-11-18 21:25:34 +0100
committer Ioana Alexandru <aioana@google.com> 2024-11-25 18:06:21 +0100
commit42db53c8ff5a75418aa8c6062cf0b36ec3e28c63 (patch)
treedc9b1937be57ca227d1a3e0d584bdba9ea034933
parentd13755c99acd8860fd21e3d0c334037966263bc1 (diff)
[Notif redesign] Reduce headerless notif margins
Bug: 378660052 Test: visual test, screenshot tests to come later Flag: android.app.notifications_redesign_templates Change-Id: Ic50a6fe93a976461243be1aa13dfcf72765a002a
-rw-r--r--core/java/android/app/Notification.java2
-rw-r--r--core/res/res/layout/notification_2025_template_collapsed_base.xml4
-rw-r--r--core/res/res/layout/notification_2025_template_collapsed_call.xml2
-rw-r--r--core/res/res/layout/notification_2025_template_collapsed_media.xml4
-rw-r--r--core/res/res/layout/notification_2025_template_collapsed_messaging.xml4
-rw-r--r--core/res/res/values/dimens.xml3
6 files changed, 11 insertions, 8 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index b68bfead5689..a78e9abb41dc 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -5964,7 +5964,7 @@ public class Notification implements Parcelable
private static void setHeaderlessVerticalMargins(RemoteViews contentView,
StandardTemplateParams p, boolean hasSecondLine) {
- if (!p.mHeaderless) {
+ if (Flags.notificationsRedesignTemplates() || !p.mHeaderless) {
return;
}
int marginDimen = hasSecondLine
diff --git a/core/res/res/layout/notification_2025_template_collapsed_base.xml b/core/res/res/layout/notification_2025_template_collapsed_base.xml
index a790e5da20de..abca117615ef 100644
--- a/core/res/res/layout/notification_2025_template_collapsed_base.xml
+++ b/core/res/res/layout/notification_2025_template_collapsed_base.xml
@@ -72,8 +72,8 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
- android:layout_marginBottom="@dimen/notification_headerless_margin_twoline"
- android:layout_marginTop="@dimen/notification_headerless_margin_twoline"
+ android:layout_marginBottom="@dimen/notification_2025_margin"
+ android:layout_marginTop="@dimen/notification_2025_margin"
android:orientation="vertical"
>
diff --git a/core/res/res/layout/notification_2025_template_collapsed_call.xml b/core/res/res/layout/notification_2025_template_collapsed_call.xml
index 06f5f0651452..d14fb4887cb2 100644
--- a/core/res/res/layout/notification_2025_template_collapsed_call.xml
+++ b/core/res/res/layout/notification_2025_template_collapsed_call.xml
@@ -44,7 +44,7 @@
android:layout_marginStart="@dimen/conversation_content_start"
android:orientation="vertical"
android:minHeight="68dp"
- android:paddingBottom="@dimen/notification_headerless_margin_twoline"
+ android:paddingBottom="@dimen/notification_2025_margin"
>
<include
diff --git a/core/res/res/layout/notification_2025_template_collapsed_media.xml b/core/res/res/layout/notification_2025_template_collapsed_media.xml
index 427c4e42e40c..e595e0cd17d5 100644
--- a/core/res/res/layout/notification_2025_template_collapsed_media.xml
+++ b/core/res/res/layout/notification_2025_template_collapsed_media.xml
@@ -74,8 +74,8 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
- android:layout_marginBottom="@dimen/notification_headerless_margin_twoline"
- android:layout_marginTop="@dimen/notification_headerless_margin_twoline"
+ android:layout_marginBottom="@dimen/notification_2025_margin"
+ android:layout_marginTop="@dimen/notification_2025_margin"
android:orientation="vertical"
>
diff --git a/core/res/res/layout/notification_2025_template_collapsed_messaging.xml b/core/res/res/layout/notification_2025_template_collapsed_messaging.xml
index f0e4c0f272fb..b3546422489d 100644
--- a/core/res/res/layout/notification_2025_template_collapsed_messaging.xml
+++ b/core/res/res/layout/notification_2025_template_collapsed_messaging.xml
@@ -98,8 +98,8 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
- android:layout_marginBottom="@dimen/notification_headerless_margin_twoline"
- android:layout_marginTop="@dimen/notification_headerless_margin_twoline"
+ android:layout_marginBottom="@dimen/notification_2025_margin"
+ android:layout_marginTop="@dimen/notification_2025_margin"
android:layout_marginStart="@dimen/notification_2025_content_margin_start"
android:clipChildren="false"
android:orientation="vertical"
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 5e405ce96aea..7de687dbd3e3 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -390,6 +390,9 @@
<!-- the size of the notification close button -->
<dimen name="notification_close_button_size">16dp</dimen>
+ <!-- Margin for all notification content -->
+ <dimen name="notification_2025_margin">16dp</dimen>
+
<!-- Vertical margin for the headerless notification content, when content has 1 line -->
<!-- 16 * 2 (margins) + 24 (1 line) = 56 (notification) -->
<dimen name="notification_headerless_margin_oneline">16dp</dimen>