Loading core/java/android/app/Notification.java +4 −15 Original line number Diff line number Diff line Loading @@ -6321,13 +6321,6 @@ 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()) { // In the collapsed view, the top line needs to accommodate both the expander and // large icon (when present) result.mHeadingFullMarginSet.applyToView(contentView, R.id.notification_top_line); // The text underneath can flow below the expander, but only if there's no large // icon to leave space for (similar to the title in the expanded version). result.mTitleMarginSet.applyToView(contentView, R.id.notification_main_column); } // The expand button uses paddings rather than margins, so we'll adjust it // separately. Loading Loading @@ -6442,7 +6435,7 @@ public class Notification implements Parcelable contentView.setImageViewIcon(R.id.right_icon, rightIcon); contentView.setIntTag(R.id.right_icon, R.id.tag_keep_when_showing_left_icon, isPromotedPicture ? 1 : 0); if (notificationsRedesignTemplates() || Flags.uiRichOngoing()) { if ((notificationsRedesignTemplates() || Flags.uiRichOngoing()) && !p.mHeaderless) { contentView.setViewLayoutMargin(R.id.right_icon, RemoteViews.MARGIN_END, getLargeIconMarginEnd(p), COMPLEX_UNIT_PX); } Loading Loading @@ -6471,7 +6464,7 @@ public class Notification implements Parcelable if (notificationsRedesignTemplates()) { int rightIconMarginPx = res.getDimensionPixelSize( R.dimen.notification_2025_right_icon_margin_end); R.dimen.notification_2025_right_icon_expanded_margin_end); int extraSpaceForExpanderPx = res.getDimensionPixelSize( R.dimen.notification_2025_extra_space_for_expander); return rightIconMarginPx + extraSpaceForExpanderPx; Loading Loading @@ -8442,12 +8435,8 @@ 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()) { // also update the end margin to account for the large icon or expander result.mHeadingFullMarginSet.applyToView(template, R.id.notification_main_column); } } else { // also update the end margin to account for the large icon or expander Resources resources = context.getResources(); result.mTitleMarginSet.applyToView(template, R.id.notification_main_column, resources.getDimension(R.dimen.notification_content_margin_end) Loading core/res/res/layout/notification_2025_right_icon.xml +2 −2 Original line number Diff line number Diff line Loading @@ -13,14 +13,14 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> <!-- Large icon to be used in notification layouts. --> <!-- Large icon to be used in expanded notification layouts. --> <com.android.internal.widget.CachingIconView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/right_icon" android:layout_width="@dimen/notification_right_icon_size" android:layout_height="@dimen/notification_right_icon_size" android:layout_gravity="top|end" android:layout_marginEnd="@dimen/notification_2025_right_icon_margin_end" android:layout_marginEnd="@dimen/notification_2025_right_icon_expanded_margin_end" android:layout_marginTop="@dimen/notification_2025_right_icon_vertical_margin" android:background="@drawable/notification_large_icon_outline" android:clipToOutline="true" Loading core/res/res/layout/notification_2025_template_collapsed_base.xml +20 −9 Original line number Diff line number Diff line Loading @@ -58,11 +58,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 @@ -71,19 +72,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_2025_content_min_height" android:clipChildren="false" android:theme="@style/Theme.DeviceDefault.Notification" Loading Loading @@ -122,7 +123,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/notification_2025_additional_margin" android:layout_marginEnd="@dimen/notification_2025_margin" android:minHeight="@dimen/notification_headerless_line_height" > <include layout="@layout/notification_2025_text" /> Loading @@ -132,21 +132,32 @@ 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" /> <com.android.internal.widget.CachingIconView 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" android:maxDrawableWidth="@dimen/notification_right_icon_size" android:maxDrawableHeight="@dimen/notification_right_icon_size" /> <FrameLayout android:id="@+id/expand_button_touch_container" 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 @@ -157,7 +168,7 @@ </FrameLayout> </FrameLayout> </LinearLayout> <include layout="@layout/notification_close_button" android:id="@+id/close_button" Loading core/res/res/layout/notification_2025_template_collapsed_call.xml +18 −8 Original line number Diff line number Diff line Loading @@ -64,18 +64,20 @@ 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" android:clipChildren="false" > <LinearLayout android:id="@+id/notification_headerless_view_column" android:layout_width="match_parent" android:layout_width="0px" android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginTop="@dimen/notification_2025_margin" android:clipChildren="false" android:orientation="vertical" Loading @@ -83,10 +85,9 @@ <NotificationTopLineView android:id="@+id/notification_top_line" android:layout_width="match_parent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minHeight="@dimen/notification_headerless_line_height" android:layout_marginEnd="@dimen/notification_2025_content_margin_end" 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_height="wrap_content" android:layout_marginEnd="@dimen/notification_2025_margin" android:minHeight="@dimen/notification_headerless_line_height" > <include layout="@layout/notification_2025_text" /> Loading @@ -132,14 +132,24 @@ </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" /> <FrameLayout android:id="@+id/expand_button_touch_container" 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 @@ -150,7 +160,7 @@ </FrameLayout> </FrameLayout> </LinearLayout> <include layout="@layout/notification_close_button" android:id="@+id/close_button" Loading core/res/res/layout/notification_2025_template_collapsed_conversation.xml +18 −8 Original line number Diff line number Diff line Loading @@ -68,17 +68,19 @@ layout_marginStart on the id/notification_headerless_view_row, we put it on id/notification_top_line, making the layout here just a bit different from the base. --> <FrameLayout <LinearLayout android:id="@+id/notification_headerless_view_row" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:clipChildren="false" > <LinearLayout android:id="@+id/notification_headerless_view_column" android:layout_width="match_parent" android:layout_width="0px" android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginTop="@dimen/notification_2025_margin" android:layout_marginStart="@dimen/notification_2025_content_margin_start" android:clipChildren="false" Loading @@ -87,10 +89,9 @@ <NotificationTopLineView android:id="@+id/notification_top_line" android:layout_width="match_parent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minHeight="@dimen/notification_headerless_line_height" android:layout_marginEnd="@dimen/notification_2025_content_margin_end" android:clipChildren="false" android:theme="@style/Theme.DeviceDefault.Notification" > Loading Loading @@ -128,7 +129,6 @@ android:id="@+id/notification_messaging" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/notification_2025_margin" android:clipChildren="false" android:spacing="@dimen/notification_messaging_spacing" /> </LinearLayout> Loading @@ -149,14 +149,24 @@ android:visibility="gone" /> <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" /> <FrameLayout android:id="@+id/expand_button_touch_container" 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 @@ -167,7 +177,7 @@ </FrameLayout> </FrameLayout> </LinearLayout> <include layout="@layout/notification_close_button" android:id="@+id/close_button" Loading Loading
core/java/android/app/Notification.java +4 −15 Original line number Diff line number Diff line Loading @@ -6321,13 +6321,6 @@ 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()) { // In the collapsed view, the top line needs to accommodate both the expander and // large icon (when present) result.mHeadingFullMarginSet.applyToView(contentView, R.id.notification_top_line); // The text underneath can flow below the expander, but only if there's no large // icon to leave space for (similar to the title in the expanded version). result.mTitleMarginSet.applyToView(contentView, R.id.notification_main_column); } // The expand button uses paddings rather than margins, so we'll adjust it // separately. Loading Loading @@ -6442,7 +6435,7 @@ public class Notification implements Parcelable contentView.setImageViewIcon(R.id.right_icon, rightIcon); contentView.setIntTag(R.id.right_icon, R.id.tag_keep_when_showing_left_icon, isPromotedPicture ? 1 : 0); if (notificationsRedesignTemplates() || Flags.uiRichOngoing()) { if ((notificationsRedesignTemplates() || Flags.uiRichOngoing()) && !p.mHeaderless) { contentView.setViewLayoutMargin(R.id.right_icon, RemoteViews.MARGIN_END, getLargeIconMarginEnd(p), COMPLEX_UNIT_PX); } Loading Loading @@ -6471,7 +6464,7 @@ public class Notification implements Parcelable if (notificationsRedesignTemplates()) { int rightIconMarginPx = res.getDimensionPixelSize( R.dimen.notification_2025_right_icon_margin_end); R.dimen.notification_2025_right_icon_expanded_margin_end); int extraSpaceForExpanderPx = res.getDimensionPixelSize( R.dimen.notification_2025_extra_space_for_expander); return rightIconMarginPx + extraSpaceForExpanderPx; Loading Loading @@ -8442,12 +8435,8 @@ 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()) { // also update the end margin to account for the large icon or expander result.mHeadingFullMarginSet.applyToView(template, R.id.notification_main_column); } } else { // also update the end margin to account for the large icon or expander Resources resources = context.getResources(); result.mTitleMarginSet.applyToView(template, R.id.notification_main_column, resources.getDimension(R.dimen.notification_content_margin_end) Loading
core/res/res/layout/notification_2025_right_icon.xml +2 −2 Original line number Diff line number Diff line Loading @@ -13,14 +13,14 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> <!-- Large icon to be used in notification layouts. --> <!-- Large icon to be used in expanded notification layouts. --> <com.android.internal.widget.CachingIconView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/right_icon" android:layout_width="@dimen/notification_right_icon_size" android:layout_height="@dimen/notification_right_icon_size" android:layout_gravity="top|end" android:layout_marginEnd="@dimen/notification_2025_right_icon_margin_end" android:layout_marginEnd="@dimen/notification_2025_right_icon_expanded_margin_end" android:layout_marginTop="@dimen/notification_2025_right_icon_vertical_margin" android:background="@drawable/notification_large_icon_outline" android:clipToOutline="true" Loading
core/res/res/layout/notification_2025_template_collapsed_base.xml +20 −9 Original line number Diff line number Diff line Loading @@ -58,11 +58,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 @@ -71,19 +72,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_2025_content_min_height" android:clipChildren="false" android:theme="@style/Theme.DeviceDefault.Notification" Loading Loading @@ -122,7 +123,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/notification_2025_additional_margin" android:layout_marginEnd="@dimen/notification_2025_margin" android:minHeight="@dimen/notification_headerless_line_height" > <include layout="@layout/notification_2025_text" /> Loading @@ -132,21 +132,32 @@ 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" /> <com.android.internal.widget.CachingIconView 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" android:maxDrawableWidth="@dimen/notification_right_icon_size" android:maxDrawableHeight="@dimen/notification_right_icon_size" /> <FrameLayout android:id="@+id/expand_button_touch_container" 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 @@ -157,7 +168,7 @@ </FrameLayout> </FrameLayout> </LinearLayout> <include layout="@layout/notification_close_button" android:id="@+id/close_button" Loading
core/res/res/layout/notification_2025_template_collapsed_call.xml +18 −8 Original line number Diff line number Diff line Loading @@ -64,18 +64,20 @@ 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" android:clipChildren="false" > <LinearLayout android:id="@+id/notification_headerless_view_column" android:layout_width="match_parent" android:layout_width="0px" android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginTop="@dimen/notification_2025_margin" android:clipChildren="false" android:orientation="vertical" Loading @@ -83,10 +85,9 @@ <NotificationTopLineView android:id="@+id/notification_top_line" android:layout_width="match_parent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minHeight="@dimen/notification_headerless_line_height" android:layout_marginEnd="@dimen/notification_2025_content_margin_end" 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_height="wrap_content" android:layout_marginEnd="@dimen/notification_2025_margin" android:minHeight="@dimen/notification_headerless_line_height" > <include layout="@layout/notification_2025_text" /> Loading @@ -132,14 +132,24 @@ </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" /> <FrameLayout android:id="@+id/expand_button_touch_container" 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 @@ -150,7 +160,7 @@ </FrameLayout> </FrameLayout> </LinearLayout> <include layout="@layout/notification_close_button" android:id="@+id/close_button" Loading
core/res/res/layout/notification_2025_template_collapsed_conversation.xml +18 −8 Original line number Diff line number Diff line Loading @@ -68,17 +68,19 @@ layout_marginStart on the id/notification_headerless_view_row, we put it on id/notification_top_line, making the layout here just a bit different from the base. --> <FrameLayout <LinearLayout android:id="@+id/notification_headerless_view_row" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:clipChildren="false" > <LinearLayout android:id="@+id/notification_headerless_view_column" android:layout_width="match_parent" android:layout_width="0px" android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginTop="@dimen/notification_2025_margin" android:layout_marginStart="@dimen/notification_2025_content_margin_start" android:clipChildren="false" Loading @@ -87,10 +89,9 @@ <NotificationTopLineView android:id="@+id/notification_top_line" android:layout_width="match_parent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minHeight="@dimen/notification_headerless_line_height" android:layout_marginEnd="@dimen/notification_2025_content_margin_end" android:clipChildren="false" android:theme="@style/Theme.DeviceDefault.Notification" > Loading Loading @@ -128,7 +129,6 @@ android:id="@+id/notification_messaging" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/notification_2025_margin" android:clipChildren="false" android:spacing="@dimen/notification_messaging_spacing" /> </LinearLayout> Loading @@ -149,14 +149,24 @@ android:visibility="gone" /> <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" /> <FrameLayout android:id="@+id/expand_button_touch_container" 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 @@ -167,7 +177,7 @@ </FrameLayout> </FrameLayout> </LinearLayout> <include layout="@layout/notification_close_button" android:id="@+id/close_button" Loading