From 4fecf780d63adc0e470356a2607816b5f0fd06e8 Mon Sep 17 00:00:00 2001 From: Ioana Alexandru Date: Fri, 7 Mar 2025 17:18:40 +0100 Subject: [Notif redesign] Remove negative margin layout from convo/call HUNs Negative margins are generally not recommended, and if we tweak the margins of the other children here a little bit we can align the actions just fine without needing a negative margin. Bug: 378660052 Test: manual + screenshot tests Flag: android.app.notifications_redesign_templates Change-Id: I58f2cf80eed5c9ce28320134acc8e834cce55684 --- ...tification_2025_conversation_icon_container.xml | 3 ++- .../notification_2025_template_collapsed_call.xml | 19 +++++-------------- ...cation_2025_template_collapsed_conversation.xml | 19 ++++++------------- ...ification_2025_template_collapsed_messaging.xml | 22 ++++++++-------------- 4 files changed, 21 insertions(+), 42 deletions(-) diff --git a/core/res/res/layout/notification_2025_conversation_icon_container.xml b/core/res/res/layout/notification_2025_conversation_icon_container.xml index 7ec2450ceb71..16c95009051c 100644 --- a/core/res/res/layout/notification_2025_conversation_icon_container.xml +++ b/core/res/res/layout/notification_2025_conversation_icon_container.xml @@ -29,7 +29,8 @@ @@ -79,7 +78,6 @@ android:layout_width="0px" android:layout_height="wrap_content" android:layout_weight="1" - android:layout_marginBottom="@dimen/notification_2025_margin" android:layout_marginTop="@dimen/notification_2025_margin" android:clipChildren="false" android:orientation="vertical" @@ -172,20 +170,13 @@ - - - - + android:layout_marginTop="@dimen/notification_2025_smart_reply_container_margin" + android:layout_marginStart="@dimen/notification_2025_content_margin_start" + android:layout_marginEnd="@dimen/notification_content_margin_end" /> + diff --git a/core/res/res/layout/notification_2025_template_collapsed_conversation.xml b/core/res/res/layout/notification_2025_template_collapsed_conversation.xml index 6cdc84b9dea7..30aba2dec837 100644 --- a/core/res/res/layout/notification_2025_template_collapsed_conversation.xml +++ b/core/res/res/layout/notification_2025_template_collapsed_conversation.xml @@ -35,7 +35,6 @@ @@ -79,6 +78,7 @@ > - - - - + android:layout_marginTop="@dimen/notification_2025_smart_reply_container_margin" + android:layout_marginStart="@dimen/notification_2025_content_margin_start" + android:layout_marginEnd="@dimen/notification_content_margin_end" /> + 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 0edf9df130f0..abed7f76af3f 100644 --- a/core/res/res/layout/notification_2025_template_collapsed_messaging.xml +++ b/core/res/res/layout/notification_2025_template_collapsed_messaging.xml @@ -38,7 +38,6 @@ @@ -61,7 +60,8 @@ android:layout_width="@dimen/notification_2025_icon_circle_size" android:layout_height="@dimen/notification_2025_icon_circle_size" android:layout_alignParentStart="true" - android:layout_margin="@dimen/notification_2025_margin" + android:layout_marginHorizontal="@dimen/notification_2025_margin" + android:layout_marginTop="@dimen/notification_2025_margin" android:background="@drawable/notification_icon_circle" android:padding="@dimen/notification_2025_icon_circle_padding" /> @@ -90,6 +90,7 @@ > - - - - + android:layout_marginTop="@dimen/notification_2025_smart_reply_container_margin" + android:layout_marginStart="@dimen/notification_2025_content_margin_start" + android:layout_marginEnd="@dimen/notification_content_margin_end" /> + -- cgit v1.2.3-59-g8ed1b From 112b11d9a4203618b3ab7f0df3d4c0d752c55b9a Mon Sep 17 00:00:00 2001 From: Ioana Alexandru Date: Mon, 10 Mar 2025 14:52:06 +0100 Subject: [Notif redesign] Replace notification_content_margin_end Replacing the old margin with the general notification_2025_margin used for most things in the redesign. They have the same 16dp value so this doesn't actually change anything visually. Also updated some leftover usages of the old notification_content_margin in the reply history container. Bug: 378660052 Test: screenshot tests should be unchanged Flag: android.app.notifications_redesign_templates Change-Id: I173a9a8baa480c445009af12884a9dd869cb259c --- .../layout/notification_2025_reply_history_container.xml | 14 +++++++------- .../layout/notification_2025_template_collapsed_base.xml | 2 +- .../layout/notification_2025_template_collapsed_call.xml | 4 ++-- .../notification_2025_template_collapsed_conversation.xml | 4 ++-- .../layout/notification_2025_template_collapsed_media.xml | 2 +- .../notification_2025_template_collapsed_messaging.xml | 4 ++-- .../notification_2025_template_compact_heads_up_base.xml | 2 +- ...tification_2025_template_compact_heads_up_messaging.xml | 2 +- .../layout/notification_2025_template_expanded_base.xml | 4 ++-- .../notification_2025_template_expanded_big_picture.xml | 6 +++--- .../notification_2025_template_expanded_big_text.xml | 4 ++-- .../layout/notification_2025_template_expanded_call.xml | 4 ++-- .../notification_2025_template_expanded_conversation.xml | 4 ++-- .../layout/notification_2025_template_expanded_inbox.xml | 4 ++-- .../layout/notification_2025_template_expanded_media.xml | 2 +- .../notification_2025_template_expanded_messaging.xml | 4 ++-- .../notification_2025_template_expanded_progress.xml | 4 ++-- .../layout/notification_2025_template_heads_up_base.xml | 2 +- 18 files changed, 36 insertions(+), 36 deletions(-) diff --git a/core/res/res/layout/notification_2025_reply_history_container.xml b/core/res/res/layout/notification_2025_reply_history_container.xml index 6923b59f34dc..256f7b89c784 100644 --- a/core/res/res/layout/notification_2025_reply_history_container.xml +++ b/core/res/res/layout/notification_2025_reply_history_container.xml @@ -28,16 +28,16 @@ android:layout_width="match_parent" android:layout_height="1dip" android:id="@+id/action_divider" - android:layout_marginTop="@dimen/notification_content_margin" - android:layout_marginBottom="@dimen/notification_content_margin" - android:layout_marginEnd="@dimen/notification_content_margin_end" + android:layout_marginTop="@dimen/notification_2025_margin" + android:layout_marginBottom="@dimen/notification_2025_margin" + android:layout_marginEnd="@dimen/notification_2025_margin" android:background="@drawable/notification_template_divider" /> @@ -46,7 +46,7 @@ android:id="@+id/notification_material_reply_text_2" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginEnd="@dimen/notification_content_margin_end" + android:layout_marginEnd="@dimen/notification_2025_margin" android:visibility="gone" android:textAppearance="@style/TextAppearance.DeviceDefault.Notification.Reply" android:singleLine="true" /> @@ -56,13 +56,13 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" - android:layout_marginEnd="@dimen/notification_content_margin_end"> + android:layout_marginEnd="@dimen/notification_2025_margin"> 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 a8d4a1b13bac..57c89b91cff7 100644 --- a/core/res/res/layout/notification_2025_template_collapsed_base.xml +++ b/core/res/res/layout/notification_2025_template_collapsed_base.xml @@ -156,7 +156,7 @@ android:id="@+id/expand_button_touch_container" android:layout_width="wrap_content" android:layout_height="match_parent" - android:minWidth="@dimen/notification_content_margin_end" + android:minWidth="@dimen/notification_2025_margin" > + android:layout_marginEnd="@dimen/notification_2025_margin" /> diff --git a/core/res/res/layout/notification_2025_template_collapsed_conversation.xml b/core/res/res/layout/notification_2025_template_collapsed_conversation.xml index 30aba2dec837..1c6fcb50dca5 100644 --- a/core/res/res/layout/notification_2025_template_collapsed_conversation.xml +++ b/core/res/res/layout/notification_2025_template_collapsed_conversation.xml @@ -167,7 +167,7 @@ android:id="@+id/expand_button_touch_container" android:layout_width="wrap_content" android:layout_height="match_parent" - android:minWidth="@dimen/notification_content_margin_end" + android:minWidth="@dimen/notification_2025_margin" > + android:layout_marginEnd="@dimen/notification_2025_margin" /> 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 75867b867069..de82f9feb512 100644 --- a/core/res/res/layout/notification_2025_template_collapsed_media.xml +++ b/core/res/res/layout/notification_2025_template_collapsed_media.xml @@ -177,7 +177,7 @@ android:id="@+id/expand_button_touch_container" android:layout_width="wrap_content" android:layout_height="match_parent" - android:minWidth="@dimen/notification_content_margin_end" + android:minWidth="@dimen/notification_2025_margin" > + android:layout_marginEnd="@dimen/notification_2025_margin" /> diff --git a/core/res/res/layout/notification_2025_template_compact_heads_up_base.xml b/core/res/res/layout/notification_2025_template_compact_heads_up_base.xml index 52bc7b8ea3bb..b32a7788c433 100644 --- a/core/res/res/layout/notification_2025_template_compact_heads_up_base.xml +++ b/core/res/res/layout/notification_2025_template_compact_heads_up_base.xml @@ -76,7 +76,7 @@ android:id="@+id/expand_button_touch_container" android:layout_width="wrap_content" android:layout_height="match_parent" - android:minWidth="@dimen/notification_content_margin_end" + android:minWidth="@dimen/notification_2025_margin" > @@ -76,7 +76,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="@dimen/notification_2025_content_margin_start" - android:layout_marginEnd="@dimen/notification_content_margin_end" + android:layout_marginEnd="@dimen/notification_2025_margin" android:layout_marginTop="@dimen/notification_2025_smart_reply_container_margin" /> diff --git a/core/res/res/layout/notification_2025_template_expanded_big_picture.xml b/core/res/res/layout/notification_2025_template_expanded_big_picture.xml index 6f8eb148c040..ead6d4cbc034 100644 --- a/core/res/res/layout/notification_2025_template_expanded_big_picture.xml +++ b/core/res/res/layout/notification_2025_template_expanded_big_picture.xml @@ -42,7 +42,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="@dimen/notification_2025_content_margin_start" - android:layout_marginEnd="@dimen/notification_content_margin_end" + android:layout_marginEnd="@dimen/notification_2025_margin" android:orientation="vertical" > @@ -66,7 +66,7 @@ android:layout_weight="1" android:layout_marginTop="13dp" android:layout_marginStart="@dimen/notification_2025_content_margin_start" - android:layout_marginEnd="@dimen/notification_content_margin_end" + android:layout_marginEnd="@dimen/notification_2025_margin" android:background="@drawable/notification_big_picture_outline" android:clipToOutline="true" android:scaleType="centerCrop" @@ -84,7 +84,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="@dimen/notification_2025_content_margin_start" - android:layout_marginEnd="@dimen/notification_content_margin_end" + android:layout_marginEnd="@dimen/notification_2025_margin" android:layout_marginTop="@dimen/notification_2025_smart_reply_container_margin" /> diff --git a/core/res/res/layout/notification_2025_template_expanded_big_text.xml b/core/res/res/layout/notification_2025_template_expanded_big_text.xml index 3c58567804cd..de5e71d2015f 100644 --- a/core/res/res/layout/notification_2025_template_expanded_big_text.xml +++ b/core/res/res/layout/notification_2025_template_expanded_big_text.xml @@ -41,7 +41,7 @@ android:layout_height="wrap_content" android:layout_gravity="top" android:paddingStart="@dimen/notification_2025_content_margin_start" - android:paddingEnd="@dimen/notification_content_margin_end" + android:paddingEnd="@dimen/notification_2025_margin" android:clipToPadding="false" android:orientation="vertical" android:layout_weight="1" @@ -82,7 +82,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="@dimen/notification_2025_content_margin_start" - android:layout_marginEnd="@dimen/notification_content_margin_end" + android:layout_marginEnd="@dimen/notification_2025_margin" android:layout_marginTop="@dimen/notification_2025_smart_reply_container_margin" /> diff --git a/core/res/res/layout/notification_2025_template_expanded_call.xml b/core/res/res/layout/notification_2025_template_expanded_call.xml index 7d561caa08da..c096bc8a4d15 100644 --- a/core/res/res/layout/notification_2025_template_expanded_call.xml +++ b/core/res/res/layout/notification_2025_template_expanded_call.xml @@ -45,7 +45,7 @@ android:layout_gravity="top" android:layout_weight="1" android:layout_marginStart="@dimen/notification_2025_content_margin_start" - android:layout_marginEnd="@dimen/notification_content_margin_end" + android:layout_marginEnd="@dimen/notification_2025_margin" android:orientation="vertical" android:clipChildren="false" > @@ -61,7 +61,7 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/notification_2025_smart_reply_container_margin" android:layout_marginStart="@dimen/notification_2025_content_margin_start" - android:layout_marginEnd="@dimen/notification_content_margin_end" /> + android:layout_marginEnd="@dimen/notification_2025_margin" /> diff --git a/core/res/res/layout/notification_2025_template_expanded_conversation.xml b/core/res/res/layout/notification_2025_template_expanded_conversation.xml index b220efc669b9..6eea8cc93aeb 100644 --- a/core/res/res/layout/notification_2025_template_expanded_conversation.xml +++ b/core/res/res/layout/notification_2025_template_expanded_conversation.xml @@ -43,7 +43,7 @@ android:layout_height="wrap_content" android:layout_gravity="top" android:layout_weight="1" - android:layout_marginEnd="@dimen/notification_content_margin_end" + android:layout_marginEnd="@dimen/notification_2025_margin" android:orientation="vertical" android:clipChildren="false" > @@ -63,7 +63,7 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/notification_2025_smart_reply_container_margin" android:layout_marginStart="@dimen/notification_2025_content_margin_start" - android:layout_marginEnd="@dimen/notification_content_margin_end" /> + android:layout_marginEnd="@dimen/notification_2025_margin" /> diff --git a/core/res/res/layout/notification_2025_template_expanded_inbox.xml b/core/res/res/layout/notification_2025_template_expanded_inbox.xml index 9d54e7eddcfa..327cd7ac71bb 100644 --- a/core/res/res/layout/notification_2025_template_expanded_inbox.xml +++ b/core/res/res/layout/notification_2025_template_expanded_inbox.xml @@ -38,7 +38,7 @@ android:layout_height="wrap_content" android:layout_gravity="top" android:paddingStart="@dimen/notification_2025_content_margin_start" - android:paddingEnd="@dimen/notification_content_margin_end" + android:paddingEnd="@dimen/notification_2025_margin" android:layout_weight="1" android:clipToPadding="false" android:orientation="vertical" @@ -125,7 +125,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="@dimen/notification_2025_content_margin_start" - android:layout_marginEnd="@dimen/notification_content_margin_end" + android:layout_marginEnd="@dimen/notification_2025_margin" android:layout_marginTop="@dimen/notification_2025_smart_reply_container_margin" /> diff --git a/core/res/res/layout/notification_2025_template_expanded_media.xml b/core/res/res/layout/notification_2025_template_expanded_media.xml index c354e8568aa1..565a558a5115 100644 --- a/core/res/res/layout/notification_2025_template_expanded_media.xml +++ b/core/res/res/layout/notification_2025_template_expanded_media.xml @@ -41,7 +41,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="@dimen/notification_2025_content_margin_start" - android:layout_marginEnd="@dimen/notification_content_margin_end" + android:layout_marginEnd="@dimen/notification_2025_margin" android:orientation="vertical" > diff --git a/core/res/res/layout/notification_2025_template_expanded_messaging.xml b/core/res/res/layout/notification_2025_template_expanded_messaging.xml index 82996dec2925..df48479e5ec3 100644 --- a/core/res/res/layout/notification_2025_template_expanded_messaging.xml +++ b/core/res/res/layout/notification_2025_template_expanded_messaging.xml @@ -43,7 +43,7 @@ android:layout_height="wrap_content" android:layout_gravity="top" android:layout_weight="1" - android:layout_marginEnd="@dimen/notification_content_margin_end" + android:layout_marginEnd="@dimen/notification_2025_margin" android:orientation="vertical" android:clipChildren="false" > @@ -63,7 +63,7 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/notification_2025_smart_reply_container_margin" android:layout_marginStart="@dimen/notification_2025_content_margin_start" - android:layout_marginEnd="@dimen/notification_content_margin_end" /> + android:layout_marginEnd="@dimen/notification_2025_margin" /> diff --git a/core/res/res/layout/notification_2025_template_expanded_progress.xml b/core/res/res/layout/notification_2025_template_expanded_progress.xml index 9a4653e73cae..b929b9ed20b7 100644 --- a/core/res/res/layout/notification_2025_template_expanded_progress.xml +++ b/core/res/res/layout/notification_2025_template_expanded_progress.xml @@ -46,7 +46,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="@dimen/notification_2025_content_margin_start" - android:layout_marginEnd="@dimen/notification_content_margin_end" + android:layout_marginEnd="@dimen/notification_2025_margin" android:orientation="vertical" > @@ -112,7 +112,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="@dimen/notification_2025_content_margin_start" - android:layout_marginEnd="@dimen/notification_content_margin_end" + android:layout_marginEnd="@dimen/notification_2025_margin" android:layout_marginTop="@dimen/notification_2025_smart_reply_container_margin" /> diff --git a/core/res/res/layout/notification_2025_template_heads_up_base.xml b/core/res/res/layout/notification_2025_template_heads_up_base.xml index 4d3b2453637d..e416c5054e00 100644 --- a/core/res/res/layout/notification_2025_template_heads_up_base.xml +++ b/core/res/res/layout/notification_2025_template_heads_up_base.xml @@ -56,7 +56,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="@dimen/notification_2025_content_margin_start" - android:layout_marginEnd="@dimen/notification_content_margin_end" + android:layout_marginEnd="@dimen/notification_2025_margin" android:layout_marginTop="@dimen/notification_2025_smart_reply_container_margin" /> -- cgit v1.2.3-59-g8ed1b