summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/res/res/layout/notification_2025_template_collapsed_base.xml9
-rw-r--r--core/res/res/layout/notification_2025_template_collapsed_media.xml9
-rw-r--r--core/res/res/values/dimens.xml8
3 files changed, 21 insertions, 5 deletions
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 cfc2a997ab54..fe8875e413c4 100644
--- a/core/res/res/layout/notification_2025_template_collapsed_base.xml
+++ b/core/res/res/layout/notification_2025_template_collapsed_base.xml
@@ -66,14 +66,17 @@
android:orientation="horizontal"
>
+ <!--
+ We use a smaller vertical margin than usual, to allow the content of custom views to
+ grow up to 48dp height when needed in collapsed notifications.
+ -->
<LinearLayout
android:id="@+id/notification_headerless_view_column"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
- android:layout_marginBottom="@dimen/notification_2025_margin"
- android:layout_marginTop="@dimen/notification_2025_margin"
+ android:layout_marginVertical="@dimen/notification_2025_reduced_margin"
android:orientation="vertical"
>
@@ -81,6 +84,7 @@
android:id="@+id/notification_top_line"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/notification_2025_additional_margin"
android:minHeight="@dimen/notification_2025_content_min_height"
android:clipChildren="false"
android:theme="@style/Theme.DeviceDefault.Notification"
@@ -118,6 +122,7 @@
<com.android.internal.widget.NotificationVanishingFrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_marginBottom="@dimen/notification_2025_additional_margin"
android:minHeight="@dimen/notification_headerless_line_height"
>
<!-- This is the simplest way to keep this text vertically centered without
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 c4ca5b5217ba..7e84292b0924 100644
--- a/core/res/res/layout/notification_2025_template_collapsed_media.xml
+++ b/core/res/res/layout/notification_2025_template_collapsed_media.xml
@@ -68,14 +68,17 @@
android:orientation="horizontal"
>
+ <!--
+ We use a smaller vertical margin than usual, to allow the content of custom views to
+ grow up to 48dp height when needed in collapsed notifications.
+ -->
<LinearLayout
android:id="@+id/notification_headerless_view_column"
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
- android:layout_marginBottom="@dimen/notification_2025_margin"
- android:layout_marginTop="@dimen/notification_2025_margin"
+ android:layout_marginVertical="@dimen/notification_2025_reduced_margin"
android:orientation="vertical"
>
@@ -83,6 +86,7 @@
android:id="@+id/notification_top_line"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/notification_2025_additional_margin"
android:minHeight="@dimen/notification_headerless_line_height"
android:clipChildren="false"
android:theme="@style/Theme.DeviceDefault.Notification"
@@ -119,6 +123,7 @@
<com.android.internal.widget.NotificationVanishingFrameLayout
android:layout_width="match_parent"
+ android:layout_marginBottom="@dimen/notification_2025_additional_margin"
android:layout_height="@dimen/notification_headerless_line_height"
>
<!-- This is the simplest way to keep this text vertically centered without
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 7a4f568fe4a4..ff0cf000ea50 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -433,6 +433,12 @@
<!-- Margin for all notification content -->
<dimen name="notification_2025_margin">16dp</dimen>
+ <!-- A smaller version of the margin to be used when we need more space for the content -->
+ <dimen name="notification_2025_reduced_margin">12dp</dimen>
+
+ <!-- The difference between the usual margin and the reduced margin -->
+ <dimen name="notification_2025_additional_margin">4dp</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>
@@ -451,7 +457,7 @@
<dimen name="notification_collapsed_height_with_summarization">156dp</dimen>
<!-- Max height of a collapsed (headerless) notification with one or two lines -->
- <!-- 16 * 2 (margins) + 48 (min content height) = 72 (notification) -->
+ <!-- 14 * 2 (reduced margins) + 48 (max collapsed content height) = 72 (notification) -->
<dimen name="notification_2025_min_height">72dp</dimen>
<!-- Height of a headerless notification with one line -->