Loading core/java/android/app/Notification.java +11 −8 Original line number Diff line number Diff line Loading @@ -6333,7 +6333,7 @@ public class Notification implements Parcelable // If there is no title, the text (or big_text) needs to wrap around the image result.mTitleMarginSet.applyToView(contentView, p.mTextViewId); contentView.setInt(p.mTextViewId, "setNumIndentLines", p.hasTitle() ? 0 : 1); } else if (notificationsRedesignTemplates() && !p.mCompact) { } else if (notificationsRedesignTemplates() && p.mNeedsExtraTextMargin) { // In the collapsed view (except for compact HUNs), the top line needs to // accommodate both the expander and large icon (when present) result.mHeadingFullMarginSet.applyToView(contentView, R.id.notification_top_line); Loading Loading @@ -7191,7 +7191,7 @@ public class Notification implements Parcelable final StandardTemplateParams p = mParams.reset() .viewType(StandardTemplateParams.VIEW_TYPE_HEADS_UP) .compact(true) .needsExtraTextMargin(false) .fillTextsFrom(this); // Notification text is shown as secondary header text // for the minimal hun when it is provided. Loading Loading @@ -8457,7 +8457,7 @@ public class Notification implements Parcelable // ensures that we don't under-pad the content, which could lead to abuse, at the // cost of making single-line custom content over-padded. Builder.setHeaderlessVerticalMargins(template, p, true /* hasSecondLine */); if (notificationsRedesignTemplates()) { if (notificationsRedesignTemplates() && p.mNeedsExtraTextMargin) { // also update the end margin to account for the large icon or expander result.mHeadingFullMarginSet.applyToView(template, R.id.notification_main_column); Loading Loading @@ -10926,7 +10926,8 @@ public class Notification implements Parcelable .hideLeftIcon(false) // allow large icon on left when grouped .hideRightIcon(numActionsToShow > 0) // right icon or actions; not both .hideProgress(true) .fillTextsFrom(mBuilder); .fillTextsFrom(mBuilder) .needsExtraTextMargin(false); TemplateBindResult result = new TemplateBindResult(); RemoteViews template = mBuilder.applyStandardTemplate( mBuilder.getCollapsedMediaLayoutResource(), p, Loading Loading @@ -16531,7 +16532,9 @@ public class Notification implements Parcelable int mViewType = VIEW_TYPE_UNSPECIFIED; boolean mHeaderless; boolean mCompact; // Whether the layout handles the end margin for the text already (to leave space for the // expander/large icon) or we need to set it separately. boolean mNeedsExtraTextMargin = true; boolean mHideAppName; boolean mHideTitle; boolean mHideSubText; Loading @@ -16557,7 +16560,7 @@ public class Notification implements Parcelable final StandardTemplateParams reset() { mViewType = VIEW_TYPE_UNSPECIFIED; mHeaderless = false; mCompact = false; mNeedsExtraTextMargin = true; mHideAppName = false; mHideTitle = false; mHideSubText = false; Loading Loading @@ -16596,8 +16599,8 @@ public class Notification implements Parcelable return this; } public StandardTemplateParams compact(boolean compact) { mCompact = compact; public StandardTemplateParams needsExtraTextMargin(boolean needsExtraTextMargin) { mNeedsExtraTextMargin = needsExtraTextMargin; return this; } core/res/res/layout/notification_2025_template_collapsed_media.xml +19 −11 Original line number Diff line number Diff line Loading @@ -60,11 +60,12 @@ android:focusable="false" /> <FrameLayout <LinearLayout android:id="@+id/notification_headerless_view_row" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginStart="@dimen/notification_2025_content_margin_start" android:orientation="horizontal" > <!-- Loading @@ -73,19 +74,19 @@ --> <LinearLayout android:id="@+id/notification_headerless_view_column" android:layout_width="match_parent" android:layout_width="0px" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_weight="1" android:layout_marginVertical="@dimen/notification_2025_reduced_margin" android:orientation="vertical" > <NotificationTopLineView android:id="@+id/notification_top_line" android:layout_width="match_parent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="@dimen/notification_2025_additional_margin" android:layout_marginEnd="@dimen/notification_2025_content_margin_end" android:minHeight="@dimen/notification_headerless_line_height" android:clipChildren="false" android:theme="@style/Theme.DeviceDefault.Notification" Loading Loading @@ -123,7 +124,6 @@ <com.android.internal.widget.NotificationVanishingFrameLayout android:layout_width="match_parent" android:layout_marginBottom="@dimen/notification_2025_additional_margin" android:layout_marginEnd="@dimen/notification_2025_margin" android:layout_height="@dimen/notification_headerless_line_height" > <include layout="@layout/notification_2025_text" /> Loading @@ -133,21 +133,30 @@ layout="@layout/notification_template_progress" android:layout_width="match_parent" android:layout_height="@dimen/notification_headerless_line_height" android:layout_marginEnd="@dimen/notification_2025_margin" /> </LinearLayout> </LinearLayout> <include layout="@layout/notification_2025_right_icon" /> <ImageView android:id="@+id/right_icon" android:layout_width="@dimen/notification_right_icon_size" android:layout_height="@dimen/notification_right_icon_size" android:layout_gravity="center_vertical|end" android:layout_marginVertical="@dimen/notification_2025_right_icon_vertical_margin" android:layout_marginStart="@dimen/notification_2025_right_icon_content_margin" android:background="@drawable/notification_large_icon_outline" android:clipToOutline="true" android:importantForAccessibility="no" android:scaleType="centerCrop" /> <LinearLayout android:id="@+id/media_actions" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|end" android:layout_marginEnd="@dimen/notification_2025_content_margin_end" android:layout_gravity="center_vertical" android:layoutDirection="ltr" android:orientation="horizontal" > Loading @@ -170,7 +179,6 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:minWidth="@dimen/notification_2025_margin" android:layout_gravity="top|end" > <include layout="@layout/notification_2025_expand_button" Loading @@ -181,7 +189,7 @@ </FrameLayout> </FrameLayout> </LinearLayout> <include layout="@layout/notification_close_button" android:id="@+id/close_button" Loading Loading
core/java/android/app/Notification.java +11 −8 Original line number Diff line number Diff line Loading @@ -6333,7 +6333,7 @@ public class Notification implements Parcelable // If there is no title, the text (or big_text) needs to wrap around the image result.mTitleMarginSet.applyToView(contentView, p.mTextViewId); contentView.setInt(p.mTextViewId, "setNumIndentLines", p.hasTitle() ? 0 : 1); } else if (notificationsRedesignTemplates() && !p.mCompact) { } else if (notificationsRedesignTemplates() && p.mNeedsExtraTextMargin) { // In the collapsed view (except for compact HUNs), the top line needs to // accommodate both the expander and large icon (when present) result.mHeadingFullMarginSet.applyToView(contentView, R.id.notification_top_line); Loading Loading @@ -7191,7 +7191,7 @@ public class Notification implements Parcelable final StandardTemplateParams p = mParams.reset() .viewType(StandardTemplateParams.VIEW_TYPE_HEADS_UP) .compact(true) .needsExtraTextMargin(false) .fillTextsFrom(this); // Notification text is shown as secondary header text // for the minimal hun when it is provided. Loading Loading @@ -8457,7 +8457,7 @@ public class Notification implements Parcelable // ensures that we don't under-pad the content, which could lead to abuse, at the // cost of making single-line custom content over-padded. Builder.setHeaderlessVerticalMargins(template, p, true /* hasSecondLine */); if (notificationsRedesignTemplates()) { if (notificationsRedesignTemplates() && p.mNeedsExtraTextMargin) { // also update the end margin to account for the large icon or expander result.mHeadingFullMarginSet.applyToView(template, R.id.notification_main_column); Loading Loading @@ -10926,7 +10926,8 @@ public class Notification implements Parcelable .hideLeftIcon(false) // allow large icon on left when grouped .hideRightIcon(numActionsToShow > 0) // right icon or actions; not both .hideProgress(true) .fillTextsFrom(mBuilder); .fillTextsFrom(mBuilder) .needsExtraTextMargin(false); TemplateBindResult result = new TemplateBindResult(); RemoteViews template = mBuilder.applyStandardTemplate( mBuilder.getCollapsedMediaLayoutResource(), p, Loading Loading @@ -16531,7 +16532,9 @@ public class Notification implements Parcelable int mViewType = VIEW_TYPE_UNSPECIFIED; boolean mHeaderless; boolean mCompact; // Whether the layout handles the end margin for the text already (to leave space for the // expander/large icon) or we need to set it separately. boolean mNeedsExtraTextMargin = true; boolean mHideAppName; boolean mHideTitle; boolean mHideSubText; Loading @@ -16557,7 +16560,7 @@ public class Notification implements Parcelable final StandardTemplateParams reset() { mViewType = VIEW_TYPE_UNSPECIFIED; mHeaderless = false; mCompact = false; mNeedsExtraTextMargin = true; mHideAppName = false; mHideTitle = false; mHideSubText = false; Loading Loading @@ -16596,8 +16599,8 @@ public class Notification implements Parcelable return this; } public StandardTemplateParams compact(boolean compact) { mCompact = compact; public StandardTemplateParams needsExtraTextMargin(boolean needsExtraTextMargin) { mNeedsExtraTextMargin = needsExtraTextMargin; return this; }
core/res/res/layout/notification_2025_template_collapsed_media.xml +19 −11 Original line number Diff line number Diff line Loading @@ -60,11 +60,12 @@ android:focusable="false" /> <FrameLayout <LinearLayout android:id="@+id/notification_headerless_view_row" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginStart="@dimen/notification_2025_content_margin_start" android:orientation="horizontal" > <!-- Loading @@ -73,19 +74,19 @@ --> <LinearLayout android:id="@+id/notification_headerless_view_column" android:layout_width="match_parent" android:layout_width="0px" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_weight="1" android:layout_marginVertical="@dimen/notification_2025_reduced_margin" android:orientation="vertical" > <NotificationTopLineView android:id="@+id/notification_top_line" android:layout_width="match_parent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="@dimen/notification_2025_additional_margin" android:layout_marginEnd="@dimen/notification_2025_content_margin_end" android:minHeight="@dimen/notification_headerless_line_height" android:clipChildren="false" android:theme="@style/Theme.DeviceDefault.Notification" Loading Loading @@ -123,7 +124,6 @@ <com.android.internal.widget.NotificationVanishingFrameLayout android:layout_width="match_parent" android:layout_marginBottom="@dimen/notification_2025_additional_margin" android:layout_marginEnd="@dimen/notification_2025_margin" android:layout_height="@dimen/notification_headerless_line_height" > <include layout="@layout/notification_2025_text" /> Loading @@ -133,21 +133,30 @@ layout="@layout/notification_template_progress" android:layout_width="match_parent" android:layout_height="@dimen/notification_headerless_line_height" android:layout_marginEnd="@dimen/notification_2025_margin" /> </LinearLayout> </LinearLayout> <include layout="@layout/notification_2025_right_icon" /> <ImageView android:id="@+id/right_icon" android:layout_width="@dimen/notification_right_icon_size" android:layout_height="@dimen/notification_right_icon_size" android:layout_gravity="center_vertical|end" android:layout_marginVertical="@dimen/notification_2025_right_icon_vertical_margin" android:layout_marginStart="@dimen/notification_2025_right_icon_content_margin" android:background="@drawable/notification_large_icon_outline" android:clipToOutline="true" android:importantForAccessibility="no" android:scaleType="centerCrop" /> <LinearLayout android:id="@+id/media_actions" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical|end" android:layout_marginEnd="@dimen/notification_2025_content_margin_end" android:layout_gravity="center_vertical" android:layoutDirection="ltr" android:orientation="horizontal" > Loading @@ -170,7 +179,6 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:minWidth="@dimen/notification_2025_margin" android:layout_gravity="top|end" > <include layout="@layout/notification_2025_expand_button" Loading @@ -181,7 +189,7 @@ </FrameLayout> </FrameLayout> </LinearLayout> <include layout="@layout/notification_close_button" android:id="@+id/close_button" Loading