Loading core/java/android/app/Notification.java +15 −4 Original line number Diff line number Diff line Loading @@ -6175,6 +6175,9 @@ public class Notification implements Parcelable // Small icon doesn't need to be reset, as it's always set. Resetting would prevent // re-using the drawable when the notification is updated. contentView.setBoolean(R.id.expand_button, "setExpanded", false); if (Flags.apiMetricStyle()) { contentView.setViewVisibility(R.id.app_name_text_divider, View.GONE); } contentView.setViewVisibility(R.id.app_name_text, View.GONE); contentView.setTextViewText(R.id.app_name_text, null); contentView.setViewVisibility(R.id.chronometer, View.GONE); Loading Loading @@ -6568,13 +6571,16 @@ public class Notification implements Parcelable private void bindNotificationHeader(RemoteViews contentView, StandardTemplateParams p) { bindSmallIcon(contentView, p); boolean hasTextToLeft = Flags.apiMetricStyle() && p.mTitleViewId == R.id.alt_title && p.hasTitle(); // Populate text left-to-right so that separators are only shown between strings boolean hasTextToLeft = bindHeaderAppName(contentView, p, false /* force */); hasTextToLeft |= bindHeaderAppName(contentView, p, false /* force */, hasTextToLeft); hasTextToLeft |= bindHeaderTextSecondary(contentView, p, hasTextToLeft); hasTextToLeft |= bindHeaderText(contentView, p, hasTextToLeft); if (!hasTextToLeft) { // If there's still no text, force add the app name so there is some text. hasTextToLeft |= bindHeaderAppName(contentView, p, true /* force */); hasTextToLeft |= bindHeaderAppName(contentView, p, true /* force */, hasTextToLeft); } bindHeaderChronometerAndTime(contentView, p, hasTextToLeft); bindPhishingAlertIcon(contentView, p); Loading Loading @@ -6708,7 +6714,7 @@ public class Notification implements Parcelable * @return {@code true} if the app name will be visible */ private boolean bindHeaderAppName(RemoteViews contentView, StandardTemplateParams p, boolean force) { boolean force, boolean hasTextToLeft) { if (p.mViewType == StandardTemplateParams.VIEW_TYPE_MINIMIZED && !force) { // unless the force flag is set, don't show the app name in the minimized state. return false; Loading @@ -6726,6 +6732,9 @@ public class Notification implements Parcelable contentView.setViewVisibility(R.id.app_name_text, View.VISIBLE); contentView.setTextViewText(R.id.app_name_text, loadHeaderAppName()); contentView.setTextColor(R.id.app_name_text, getSecondaryTextColor(p)); if (Flags.apiMetricStyle() && hasTextToLeft) { contentView.setViewVisibility(R.id.app_name_text_divider, View.VISIBLE); } return true; } Loading Loading @@ -11827,7 +11836,9 @@ public class Notification implements Parcelable public RemoteViews makeExpandedContentView() { final StandardTemplateParams p = mBuilder.mParams.reset() .viewType(StandardTemplateParams.VIEW_TYPE_EXPANDED) .fillTextsFrom(mBuilder).text(null) .fillTextsFrom(mBuilder) .text(null) .titleViewId(R.id.alt_title) .hideRightIcon(true); final TemplateBindResult result = new TemplateBindResult(); final RemoteViews contentView = getStandardView( Loading core/res/res/layout/notification_2025_template_expanded_metric.xml +0 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,6 @@ android:orientation="vertical" > <include layout="@layout/notification_2025_title" /> <include android:layout_width="match_parent" android:layout_height="@dimen/notification_progress_bar_height" Loading core/res/res/layout/notification_2025_top_line_views.xml +21 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,27 @@ <merge xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:id="@+id/alt_title" android:textAppearance="@style/TextAppearance.DeviceDefault.Notification.Title" android:layout_width="match_parent" android:layout_height="wrap_content" android:maxLines="1" android:ellipsize="end" android:textAlignment="viewStart" android:visibility="gone" /> <TextView android:id="@+id/app_name_text_divider" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.DeviceDefault.Notification.Info" android:layout_marginStart="@dimen/notification_header_separating_margin" android:layout_marginEnd="@dimen/notification_header_separating_margin" android:text="@string/notification_header_divider_symbol" android:visibility="gone" /> <com.android.internal.widget.ObservableTextView android:id="@+id/app_name_text" android:layout_width="wrap_content" Loading core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -234,6 +234,8 @@ <java-symbol type="id" name="metric_unit_0" /> <java-symbol type="id" name="metric_unit_1" /> <java-symbol type="id" name="metric_unit_2" /> <java-symbol type="id" name="alt_title" /> <java-symbol type="id" name="app_name_text_divider" /> <java-symbol type="id" name="status_bar_latest_event_content" /> <java-symbol type="id" name="notification_main_column" /> <java-symbol type="id" name="notification_headerless_view_column" /> Loading Loading
core/java/android/app/Notification.java +15 −4 Original line number Diff line number Diff line Loading @@ -6175,6 +6175,9 @@ public class Notification implements Parcelable // Small icon doesn't need to be reset, as it's always set. Resetting would prevent // re-using the drawable when the notification is updated. contentView.setBoolean(R.id.expand_button, "setExpanded", false); if (Flags.apiMetricStyle()) { contentView.setViewVisibility(R.id.app_name_text_divider, View.GONE); } contentView.setViewVisibility(R.id.app_name_text, View.GONE); contentView.setTextViewText(R.id.app_name_text, null); contentView.setViewVisibility(R.id.chronometer, View.GONE); Loading Loading @@ -6568,13 +6571,16 @@ public class Notification implements Parcelable private void bindNotificationHeader(RemoteViews contentView, StandardTemplateParams p) { bindSmallIcon(contentView, p); boolean hasTextToLeft = Flags.apiMetricStyle() && p.mTitleViewId == R.id.alt_title && p.hasTitle(); // Populate text left-to-right so that separators are only shown between strings boolean hasTextToLeft = bindHeaderAppName(contentView, p, false /* force */); hasTextToLeft |= bindHeaderAppName(contentView, p, false /* force */, hasTextToLeft); hasTextToLeft |= bindHeaderTextSecondary(contentView, p, hasTextToLeft); hasTextToLeft |= bindHeaderText(contentView, p, hasTextToLeft); if (!hasTextToLeft) { // If there's still no text, force add the app name so there is some text. hasTextToLeft |= bindHeaderAppName(contentView, p, true /* force */); hasTextToLeft |= bindHeaderAppName(contentView, p, true /* force */, hasTextToLeft); } bindHeaderChronometerAndTime(contentView, p, hasTextToLeft); bindPhishingAlertIcon(contentView, p); Loading Loading @@ -6708,7 +6714,7 @@ public class Notification implements Parcelable * @return {@code true} if the app name will be visible */ private boolean bindHeaderAppName(RemoteViews contentView, StandardTemplateParams p, boolean force) { boolean force, boolean hasTextToLeft) { if (p.mViewType == StandardTemplateParams.VIEW_TYPE_MINIMIZED && !force) { // unless the force flag is set, don't show the app name in the minimized state. return false; Loading @@ -6726,6 +6732,9 @@ public class Notification implements Parcelable contentView.setViewVisibility(R.id.app_name_text, View.VISIBLE); contentView.setTextViewText(R.id.app_name_text, loadHeaderAppName()); contentView.setTextColor(R.id.app_name_text, getSecondaryTextColor(p)); if (Flags.apiMetricStyle() && hasTextToLeft) { contentView.setViewVisibility(R.id.app_name_text_divider, View.VISIBLE); } return true; } Loading Loading @@ -11827,7 +11836,9 @@ public class Notification implements Parcelable public RemoteViews makeExpandedContentView() { final StandardTemplateParams p = mBuilder.mParams.reset() .viewType(StandardTemplateParams.VIEW_TYPE_EXPANDED) .fillTextsFrom(mBuilder).text(null) .fillTextsFrom(mBuilder) .text(null) .titleViewId(R.id.alt_title) .hideRightIcon(true); final TemplateBindResult result = new TemplateBindResult(); final RemoteViews contentView = getStandardView( Loading
core/res/res/layout/notification_2025_template_expanded_metric.xml +0 −1 Original line number Diff line number Diff line Loading @@ -49,7 +49,6 @@ android:orientation="vertical" > <include layout="@layout/notification_2025_title" /> <include android:layout_width="match_parent" android:layout_height="@dimen/notification_progress_bar_height" Loading
core/res/res/layout/notification_2025_top_line_views.xml +21 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,27 @@ <merge xmlns:android="http://schemas.android.com/apk/res/android"> <TextView android:id="@+id/alt_title" android:textAppearance="@style/TextAppearance.DeviceDefault.Notification.Title" android:layout_width="match_parent" android:layout_height="wrap_content" android:maxLines="1" android:ellipsize="end" android:textAlignment="viewStart" android:visibility="gone" /> <TextView android:id="@+id/app_name_text_divider" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.DeviceDefault.Notification.Info" android:layout_marginStart="@dimen/notification_header_separating_margin" android:layout_marginEnd="@dimen/notification_header_separating_margin" android:text="@string/notification_header_divider_symbol" android:visibility="gone" /> <com.android.internal.widget.ObservableTextView android:id="@+id/app_name_text" android:layout_width="wrap_content" Loading
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -234,6 +234,8 @@ <java-symbol type="id" name="metric_unit_0" /> <java-symbol type="id" name="metric_unit_1" /> <java-symbol type="id" name="metric_unit_2" /> <java-symbol type="id" name="alt_title" /> <java-symbol type="id" name="app_name_text_divider" /> <java-symbol type="id" name="status_bar_latest_event_content" /> <java-symbol type="id" name="notification_main_column" /> <java-symbol type="id" name="notification_headerless_view_column" /> Loading