diff options
| author | 2024-11-22 13:39:31 +0100 | |
|---|---|---|
| committer | 2024-11-25 18:12:24 +0100 | |
| commit | b33444e601fb2bd8319872c4fbe136b211b9cefc (patch) | |
| tree | 742e1af17b4dedccfd66413f321fe28d74a07198 | |
| parent | 42db53c8ff5a75418aa8c6062cf0b36ec3e28c63 (diff) | |
[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
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 @@ <com.android.internal.widget.NotificationMaxHeightFrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:minHeight="@dimen/notification_min_height" + android:minHeight="@dimen/notification_2025_min_height" android:clipChildren="false" > 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 @@ <!-- The height of each of the 1 or 2 lines in the headerless notification template --> <dimen name="notification_headerless_line_height">24dp</dimen> - <!-- vertical margin for the headerless notification content --> + <!-- The minimum height of the notification content (even when there's only one line of text) --> + <dimen name="notification_2025_content_min_height">40dp</dimen> + + <!-- Height of a headerless notification with one or two lines --> + <!-- 16 * 2 (margins) + 40 (min content height) = 72 (notification) --> + <dimen name="notification_2025_min_height">72dp</dimen> + + <!-- Height of a headerless notification with one line --> + <!-- 16 * 2 (margins) + 24 (1 line) = 56 (notification) --> <dimen name="notification_headerless_min_height">56dp</dimen> - <!-- Height of a small notification in the status bar --> + <!-- Height of a small two-line notification --> + <!-- 20 * 2 (margins) + 24 * 2 (2 lines) = 88 (notification) --> <dimen name="notification_min_height">88dp</dimen> <!-- The width of the big icons in notifications. --> 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 @@ <!-- The size of a bluetooth indicator icon that displays next to the RSSI status icon. --> <dimen name="status_bar_connected_device_bt_indicator_size">17dp</dimen> + <!-- Height of a small notification in the status bar (2025 redesign version) --> + <dimen name="notification_2025_min_height">@*android:dimen/notification_2025_min_height</dimen> + <!-- Height of a small notification in the status bar--> <dimen name="notification_min_height">@*android:dimen/notification_min_height</dimen> 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, |