From e31d5f3f482c2c4778e6bf318a25a9742aa43075 Mon Sep 17 00:00:00 2001 From: Ibrahim Yilmaz Date: Tue, 11 Feb 2025 23:19:53 +0000 Subject: [RON] Fix LargeIcon alignment for RONs Since there is no expander, notification topline view grows to the end of its parent. So it's drawn close or under the large icon depending on the notification header content. This CL adds expand button spacer which takes up as much space as minimal expander so that notification topline view layouts correctly. Bug: 393369727 Test: Screenshot tests (for existing UI) && screenshots for large icon will come after Flag: com.android.systemui.ui_rich_ongoing_force_expanded Change-Id: Ic75b26ec59d7d1f61db2a41d8165850bc1571bd0 --- .../layout/notification_2025_template_header.xml | 26 ++++++++++++++++++---- .../res/layout/notification_template_header.xml | 24 ++++++++++++++++---- core/res/res/values/symbols.xml | 2 ++ .../row/wrapper/NotificationHeaderViewWrapper.java | 10 +++++++++ 4 files changed, 54 insertions(+), 8 deletions(-) diff --git a/core/res/res/layout/notification_2025_template_header.xml b/core/res/res/layout/notification_2025_template_header.xml index 72b3798e0780..5aae67802af9 100644 --- a/core/res/res/layout/notification_2025_template_header.xml +++ b/core/res/res/layout/notification_2025_template_header.xml @@ -59,7 +59,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentStart="true" - android:layout_toStartOf="@id/expand_button" + android:layout_toStartOf="@id/expand_button_container" android:layout_alignWithParentIfMissing="true" android:layout_marginVertical="@dimen/notification_2025_margin" android:clipChildren="false" @@ -81,12 +81,30 @@ android:focusable="false" /> - + android:layout_alignParentEnd="true" + android:orientation="vertical" + > + + + + - + android:layout_alignParentEnd="true" + android:orientation="vertical" + > + + + + + diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java index e9eecdd8a26f..e8affaa4b60f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java @@ -31,6 +31,7 @@ import android.view.ViewGroup; import android.view.animation.Interpolator; import android.view.animation.PathInterpolator; import android.widget.DateTimeView; +import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; @@ -41,6 +42,7 @@ import com.android.app.animation.Interpolators; import com.android.internal.widget.CachingIconView; import com.android.internal.widget.NotificationCloseButton; import com.android.internal.widget.NotificationExpandButton; +import com.android.systemui.Flags; import com.android.systemui.res.R; import com.android.systemui.statusbar.TransformableView; import com.android.systemui.statusbar.ViewTransformationHelper; @@ -67,6 +69,7 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper imple private CachingIconView mIcon; private NotificationCloseButton mCloseButton; private NotificationExpandButton mExpandButton; + private FrameLayout mExpandButtonSpacer; private View mAltExpandTarget; private View mIconContainer; protected NotificationHeaderView mNotificationHeader; @@ -154,6 +157,10 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper imple mHeaderText = mView.findViewById(com.android.internal.R.id.header_text); mAppNameText = mView.findViewById(com.android.internal.R.id.app_name_text); mExpandButton = mView.findViewById(com.android.internal.R.id.expand_button); + if (Flags.uiRichOngoingForceExpanded()) { + mExpandButtonSpacer = + mView.findViewById(com.android.internal.R.id.expand_button_spacer); + } mAltExpandTarget = mView.findViewById(com.android.internal.R.id.alternate_expand_target); mIconContainer = mView.findViewById(com.android.internal.R.id.conversation_icon_container); mWorkProfileImage = mView.findViewById(com.android.internal.R.id.profile_badge); @@ -295,6 +302,9 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper imple boolean expandable, View.OnClickListener onClickListener, boolean requestLayout) { + if (Flags.uiRichOngoingForceExpanded() && mExpandButtonSpacer != null) { + mExpandButtonSpacer.setVisibility(expandable ? GONE : VISIBLE); + } mExpandButton.setVisibility(expandable ? VISIBLE : GONE); mExpandButton.setOnClickListener(expandable ? onClickListener : null); if (mAltExpandTarget != null) { -- cgit v1.2.3-59-g8ed1b