From b33444e601fb2bd8319872c4fbe136b211b9cefc Mon Sep 17 00:00:00 2001 From: Ioana Alexandru Date: Fri, 22 Nov 2024 13:39:31 +0100 Subject: [Notif redesign] Increase min height of notif Both one-line notifications and header-only notifications have the same height as the small two-line notification now. Bug: 378660052 Test: visual test, screenshot tests to come later Flag: android.app.notifications_redesign_templates Change-Id: I835d947ad3b9c3d418655a16958a60120740b309 --- .../layout/notification_2025_template_collapsed_base.xml | 4 ++-- .../layout/notification_2025_template_collapsed_call.xml | 3 +-- .../layout/notification_2025_template_collapsed_media.xml | 2 +- .../notification_2025_template_collapsed_messaging.xml | 2 +- core/res/res/values/dimens.xml | 13 +++++++++++-- packages/SystemUI/res/values/dimens.xml | 3 +++ .../notification/row/ExpandableNotificationRow.java | 12 +++++++++--- 7 files changed, 28 insertions(+), 11 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 abca117615ef..09c02c9994f4 100644 --- a/core/res/res/layout/notification_2025_template_collapsed_base.xml +++ b/core/res/res/layout/notification_2025_template_collapsed_base.xml @@ -20,7 +20,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" - android:minHeight="@dimen/notification_headerless_min_height" + android:minHeight="@dimen/notification_2025_min_height" android:tag="base" > @@ -81,7 +81,7 @@ android:id="@+id/notification_top_line" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:minHeight="@dimen/notification_headerless_line_height" + android:minHeight="@dimen/notification_2025_content_min_height" android:clipChildren="false" android:theme="@style/Theme.DeviceDefault.Notification" > 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 d14fb4887cb2..614444d6b2f0 100644 --- a/core/res/res/layout/notification_2025_template_collapsed_call.xml +++ b/core/res/res/layout/notification_2025_template_collapsed_call.xml @@ -32,7 +32,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:minHeight="88dp" + android:minHeight="@dimen/notification_2025_min_height" android:orientation="horizontal" > @@ -43,7 +43,6 @@ android:layout_weight="1" android:layout_marginStart="@dimen/conversation_content_start" android:orientation="vertical" - android:minHeight="68dp" android:paddingBottom="@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 e595e0cd17d5..f539105368e7 100644 --- a/core/res/res/layout/notification_2025_template_collapsed_media.xml +++ b/core/res/res/layout/notification_2025_template_collapsed_media.xml @@ -23,7 +23,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" - android:minHeight="@dimen/notification_min_height" + android:minHeight="@dimen/notification_2025_min_height" android:tag="media" > 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 b3546422489d..ddf3ebceaa46 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,7 @@ diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index 7de687dbd3e3..f53acbfac71d 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -404,10 +404,19 @@ 24dp - + + 40dp + + + + 72dp + + + 56dp - + + 88dp diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 2cbadd5ad5f0..6097f55dc71e 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -236,6 +236,9 @@ 17dp + + @*android:dimen/notification_2025_min_height + @*android:dimen/notification_min_height 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 b7ab996a608c..7ad65fc64735 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 @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.notification.row; +import static android.app.Flags.notificationsRedesignTemplates; import static android.app.Notification.Action.SEMANTIC_ACTION_MARK_CONVERSATION_AS_PRIORITY; import static android.service.notification.NotificationListenerService.REASON_CANCEL; @@ -102,6 +103,7 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.provider.NotificationDismissibilityProvider; import com.android.systemui.statusbar.notification.collection.render.GroupExpansionManager; import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager; +import com.android.systemui.statusbar.notification.headsup.HeadsUpManager; import com.android.systemui.statusbar.notification.headsup.PinnedStatus; import com.android.systemui.statusbar.notification.logging.NotificationCounters; import com.android.systemui.statusbar.notification.people.PeopleNotificationIdentifier; @@ -121,7 +123,6 @@ import com.android.systemui.statusbar.notification.stack.NotificationChildrenCon import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.notification.stack.SwipeableView; import com.android.systemui.statusbar.phone.KeyguardBypassController; -import com.android.systemui.statusbar.notification.headsup.HeadsUpManager; import com.android.systemui.statusbar.policy.InflatedSmartReplyState; import com.android.systemui.statusbar.policy.RemoteInputView; import com.android.systemui.statusbar.policy.SmartReplyConstants; @@ -2083,8 +2084,13 @@ public class ExpandableNotificationRow extends ActivatableNotificationView R.dimen.notification_min_height_before_p); mMaxSmallHeightBeforeS = NotificationUtils.getFontScaledHeight(mContext, R.dimen.notification_min_height_before_s); - mMaxSmallHeight = NotificationUtils.getFontScaledHeight(mContext, - R.dimen.notification_min_height); + if (notificationsRedesignTemplates()) { + mMaxSmallHeight = NotificationUtils.getFontScaledHeight(mContext, + R.dimen.notification_2025_min_height); + } else { + mMaxSmallHeight = NotificationUtils.getFontScaledHeight(mContext, + R.dimen.notification_min_height); + } mMaxSmallHeightLarge = NotificationUtils.getFontScaledHeight(mContext, R.dimen.notification_min_height_increased); mMaxExpandedHeight = NotificationUtils.getFontScaledHeight(mContext, -- cgit v1.2.3-59-g8ed1b