Loading core/java/android/app/Notification.java +37 −37 Original line number Diff line number Diff line Loading @@ -6470,10 +6470,12 @@ public class Notification implements Parcelable contentView.setViewVisibility(R.id.notification_material_reply_text_3, View.GONE); contentView.setTextViewText(R.id.notification_material_reply_text_3, null); if (!notificationsRedesignTemplates()) { // This may get erased by bindSnoozeAction, or if we're showing the bubble icon contentView.setViewLayoutMarginDimen(R.id.notification_action_list_margin_target, RemoteViews.MARGIN_BOTTOM, R.dimen.notification_content_margin); } } private boolean bindSnoozeAction(RemoteViews contentView, StandardTemplateParams p) { boolean hideSnoozeButton = mN.isFgsOrUij() Loading @@ -6489,7 +6491,7 @@ public class Notification implements Parcelable final boolean snoozeEnabled = !hideSnoozeButton && mContext.getContentResolver() != null && isSnoozeSettingEnabled(); if (snoozeEnabled) { if (!notificationsRedesignTemplates() && snoozeEnabled) { contentView.setViewLayoutMarginDimen(R.id.notification_action_list_margin_target, RemoteViews.MARGIN_BOTTOM, 0); } Loading Loading @@ -6569,44 +6571,18 @@ public class Notification implements Parcelable } boolean validRemoteInput = false; // With the new design, the actions_container should always be visible to act as padding // when there are no actions. We're making its child GONE instead. int actionsContainerForVisibilityChange = notificationsRedesignTemplates() ? R.id.actions_container_layout : R.id.actions_container; if (numActions > 0 && !p.mHideActions) { contentView.setViewVisibility(R.id.actions_container, View.VISIBLE); contentView.setViewVisibility(actionsContainerForVisibilityChange, View.VISIBLE); contentView.setViewVisibility(R.id.actions, View.VISIBLE); contentView.setViewLayoutMarginDimen(R.id.notification_action_list_margin_target, RemoteViews.MARGIN_BOTTOM, 0); if (notificationsRedesignTemplates()) { // No need for additional space under smart replies/smart actions. contentView.setViewLayoutMarginDimen(R.id.smart_reply_container, RemoteViews.MARGIN_BOTTOM, 0); if (emphasizedMode) { // Emphasized actions look similar to smart replies, so let's use the same // margins. contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_TOP, R.dimen.notification_2025_smart_reply_container_margin); contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_BOTTOM, R.dimen.notification_2025_smart_reply_container_margin); } else { contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_TOP, 0); contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_BOTTOM, R.dimen.notification_2025_action_list_margin_bottom); } } updateMarginsForActions(contentView, emphasizedMode); validRemoteInput = populateActionsContainer(contentView, p, nonContextualActions, numActions, emphasizedMode); } else { contentView.setViewVisibility(R.id.actions_container, View.GONE); if (notificationsRedesignTemplates() && !snoozeEnabled) { // Make sure smart replies & smart actions have enough space at the bottom // (if present) when there are no actions. This should be set to 0 if we're // showing the snooze or bubble buttons. contentView.setViewLayoutMarginDimen(R.id.smart_reply_container, RemoteViews.MARGIN_BOTTOM, R.dimen.notification_2025_smart_reply_container_margin); } contentView.setViewVisibility(actionsContainerForVisibilityChange, View.GONE); } RemoteInputHistoryItem[] replyText = getParcelableArrayFromBundle( Loading Loading @@ -6652,6 +6628,30 @@ public class Notification implements Parcelable return contentView; } private void updateMarginsForActions(RemoteViews contentView, boolean emphasizedMode) { if (notificationsRedesignTemplates()) { if (emphasizedMode) { // Emphasized actions look similar to smart replies, so let's use the same // margins. contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_TOP, R.dimen.notification_2025_smart_reply_container_margin); contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_BOTTOM, R.dimen.notification_2025_smart_reply_container_margin); } else { contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_TOP, 0); contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_BOTTOM, R.dimen.notification_2025_action_list_margin_bottom); } } else { contentView.setViewLayoutMarginDimen(R.id.notification_action_list_margin_target, RemoteViews.MARGIN_BOTTOM, 0); } } private boolean populateActionsContainer(RemoteViews contentView, StandardTemplateParams p, List<Action> nonContextualActions, int numActions, boolean emphasizedMode) { boolean validRemoteInput = false; Loading core/res/res/layout/notification_2025_action_list.xml +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ android:layout_height="wrap_content" android:layout_gravity="bottom" android:layout_marginBottom="@dimen/notification_2025_action_list_margin_bottom" android:minHeight="@dimen/notification_2025_action_list_min_height" > <LinearLayout Loading core/res/res/layout/notification_2025_template_collapsed_base.xml +0 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,6 @@ android:id="@+id/notification_headerless_view_column" 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" Loading core/res/res/layout/notification_2025_template_collapsed_call.xml +0 −2 Original line number Diff line number Diff line Loading @@ -78,7 +78,6 @@ android:id="@+id/notification_headerless_view_column" android:layout_width="0px" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_weight="1" android:layout_marginBottom="@dimen/notification_2025_margin" android:layout_marginTop="@dimen/notification_2025_margin" Loading Loading @@ -174,7 +173,6 @@ </FrameLayout> <LinearLayout android:id="@+id/notification_action_list_margin_target" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="-20dp" Loading core/res/res/layout/notification_2025_template_collapsed_conversation.xml +5 −13 Original line number Diff line number Diff line Loading @@ -78,17 +78,10 @@ android:clipChildren="false" > <!-- NOTE: because messaging will always have 2 lines, this LinearLayout should NOT have the id/notification_headerless_view_column, as that is used for modifying vertical margins to accommodate the single-line state that base supports --> <LinearLayout android:layout_width="0px" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_weight="1" android:layout_marginBottom="@dimen/notification_2025_margin" android:layout_marginTop="@dimen/notification_2025_margin" android:layout_marginStart="@dimen/notification_2025_content_margin_start" android:clipChildren="false" Loading Loading @@ -150,7 +143,6 @@ android:layout_height="@dimen/notification_right_icon_size" android:layout_gravity="center_vertical|end" android:layout_marginTop="@dimen/notification_2025_margin" android:layout_marginBottom="@dimen/notification_2025_margin" android:layout_marginStart="@dimen/notification_2025_right_icon_content_margin" android:forceHasOverlappingRendering="false" android:spacing="0dp" Loading Loading @@ -197,7 +189,6 @@ </FrameLayout> <LinearLayout android:id="@+id/notification_action_list_margin_target" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="-20dp" Loading @@ -211,5 +202,6 @@ android:layout_marginEnd="@dimen/notification_content_margin_end" /> <include layout="@layout/notification_2025_action_list" /> </LinearLayout> </LinearLayout> </com.android.internal.widget.ConversationLayout> Loading
core/java/android/app/Notification.java +37 −37 Original line number Diff line number Diff line Loading @@ -6470,10 +6470,12 @@ public class Notification implements Parcelable contentView.setViewVisibility(R.id.notification_material_reply_text_3, View.GONE); contentView.setTextViewText(R.id.notification_material_reply_text_3, null); if (!notificationsRedesignTemplates()) { // This may get erased by bindSnoozeAction, or if we're showing the bubble icon contentView.setViewLayoutMarginDimen(R.id.notification_action_list_margin_target, RemoteViews.MARGIN_BOTTOM, R.dimen.notification_content_margin); } } private boolean bindSnoozeAction(RemoteViews contentView, StandardTemplateParams p) { boolean hideSnoozeButton = mN.isFgsOrUij() Loading @@ -6489,7 +6491,7 @@ public class Notification implements Parcelable final boolean snoozeEnabled = !hideSnoozeButton && mContext.getContentResolver() != null && isSnoozeSettingEnabled(); if (snoozeEnabled) { if (!notificationsRedesignTemplates() && snoozeEnabled) { contentView.setViewLayoutMarginDimen(R.id.notification_action_list_margin_target, RemoteViews.MARGIN_BOTTOM, 0); } Loading Loading @@ -6569,44 +6571,18 @@ public class Notification implements Parcelable } boolean validRemoteInput = false; // With the new design, the actions_container should always be visible to act as padding // when there are no actions. We're making its child GONE instead. int actionsContainerForVisibilityChange = notificationsRedesignTemplates() ? R.id.actions_container_layout : R.id.actions_container; if (numActions > 0 && !p.mHideActions) { contentView.setViewVisibility(R.id.actions_container, View.VISIBLE); contentView.setViewVisibility(actionsContainerForVisibilityChange, View.VISIBLE); contentView.setViewVisibility(R.id.actions, View.VISIBLE); contentView.setViewLayoutMarginDimen(R.id.notification_action_list_margin_target, RemoteViews.MARGIN_BOTTOM, 0); if (notificationsRedesignTemplates()) { // No need for additional space under smart replies/smart actions. contentView.setViewLayoutMarginDimen(R.id.smart_reply_container, RemoteViews.MARGIN_BOTTOM, 0); if (emphasizedMode) { // Emphasized actions look similar to smart replies, so let's use the same // margins. contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_TOP, R.dimen.notification_2025_smart_reply_container_margin); contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_BOTTOM, R.dimen.notification_2025_smart_reply_container_margin); } else { contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_TOP, 0); contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_BOTTOM, R.dimen.notification_2025_action_list_margin_bottom); } } updateMarginsForActions(contentView, emphasizedMode); validRemoteInput = populateActionsContainer(contentView, p, nonContextualActions, numActions, emphasizedMode); } else { contentView.setViewVisibility(R.id.actions_container, View.GONE); if (notificationsRedesignTemplates() && !snoozeEnabled) { // Make sure smart replies & smart actions have enough space at the bottom // (if present) when there are no actions. This should be set to 0 if we're // showing the snooze or bubble buttons. contentView.setViewLayoutMarginDimen(R.id.smart_reply_container, RemoteViews.MARGIN_BOTTOM, R.dimen.notification_2025_smart_reply_container_margin); } contentView.setViewVisibility(actionsContainerForVisibilityChange, View.GONE); } RemoteInputHistoryItem[] replyText = getParcelableArrayFromBundle( Loading Loading @@ -6652,6 +6628,30 @@ public class Notification implements Parcelable return contentView; } private void updateMarginsForActions(RemoteViews contentView, boolean emphasizedMode) { if (notificationsRedesignTemplates()) { if (emphasizedMode) { // Emphasized actions look similar to smart replies, so let's use the same // margins. contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_TOP, R.dimen.notification_2025_smart_reply_container_margin); contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_BOTTOM, R.dimen.notification_2025_smart_reply_container_margin); } else { contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_TOP, 0); contentView.setViewLayoutMarginDimen(R.id.actions_container, RemoteViews.MARGIN_BOTTOM, R.dimen.notification_2025_action_list_margin_bottom); } } else { contentView.setViewLayoutMarginDimen(R.id.notification_action_list_margin_target, RemoteViews.MARGIN_BOTTOM, 0); } } private boolean populateActionsContainer(RemoteViews contentView, StandardTemplateParams p, List<Action> nonContextualActions, int numActions, boolean emphasizedMode) { boolean validRemoteInput = false; Loading
core/res/res/layout/notification_2025_action_list.xml +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ android:layout_height="wrap_content" android:layout_gravity="bottom" android:layout_marginBottom="@dimen/notification_2025_action_list_margin_bottom" android:minHeight="@dimen/notification_2025_action_list_min_height" > <LinearLayout Loading
core/res/res/layout/notification_2025_template_collapsed_base.xml +0 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,6 @@ android:id="@+id/notification_headerless_view_column" 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" Loading
core/res/res/layout/notification_2025_template_collapsed_call.xml +0 −2 Original line number Diff line number Diff line Loading @@ -78,7 +78,6 @@ android:id="@+id/notification_headerless_view_column" android:layout_width="0px" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_weight="1" android:layout_marginBottom="@dimen/notification_2025_margin" android:layout_marginTop="@dimen/notification_2025_margin" Loading Loading @@ -174,7 +173,6 @@ </FrameLayout> <LinearLayout android:id="@+id/notification_action_list_margin_target" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="-20dp" Loading
core/res/res/layout/notification_2025_template_collapsed_conversation.xml +5 −13 Original line number Diff line number Diff line Loading @@ -78,17 +78,10 @@ android:clipChildren="false" > <!-- NOTE: because messaging will always have 2 lines, this LinearLayout should NOT have the id/notification_headerless_view_column, as that is used for modifying vertical margins to accommodate the single-line state that base supports --> <LinearLayout android:layout_width="0px" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_weight="1" android:layout_marginBottom="@dimen/notification_2025_margin" android:layout_marginTop="@dimen/notification_2025_margin" android:layout_marginStart="@dimen/notification_2025_content_margin_start" android:clipChildren="false" Loading Loading @@ -150,7 +143,6 @@ android:layout_height="@dimen/notification_right_icon_size" android:layout_gravity="center_vertical|end" android:layout_marginTop="@dimen/notification_2025_margin" android:layout_marginBottom="@dimen/notification_2025_margin" android:layout_marginStart="@dimen/notification_2025_right_icon_content_margin" android:forceHasOverlappingRendering="false" android:spacing="0dp" Loading Loading @@ -197,7 +189,6 @@ </FrameLayout> <LinearLayout android:id="@+id/notification_action_list_margin_target" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="-20dp" Loading @@ -211,5 +202,6 @@ android:layout_marginEnd="@dimen/notification_content_margin_end" /> <include layout="@layout/notification_2025_action_list" /> </LinearLayout> </LinearLayout> </com.android.internal.widget.ConversationLayout>