Loading packages/SystemUI/res/drawable/notification_2025_smart_reply_button_background.xml +1 −0 Original line number Original line Diff line number Diff line Loading @@ -28,6 +28,7 @@ android:insetBottom="8dp"> android:insetBottom="8dp"> <shape android:shape="rectangle"> <shape android:shape="rectangle"> <corners android:radius="@dimen/notification_2025_smart_reply_button_corner_radius" /> <corners android:radius="@dimen/notification_2025_smart_reply_button_corner_radius" /> <!-- Note that the stroke and fill colors are being overridden in SmartReplyView. --> <stroke android:width="@dimen/smart_reply_button_stroke_width" <stroke android:width="@dimen/smart_reply_button_stroke_width" android:color="@color/smart_reply_button_stroke" /> android:color="@color/smart_reply_button_stroke" /> <solid android:color="@color/smart_reply_button_background"/> <solid android:color="@color/smart_reply_button_background"/> Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java +16 −2 Original line number Original line Diff line number Diff line package com.android.systemui.statusbar.policy; package com.android.systemui.statusbar.policy; import static android.app.Flags.notificationsRedesignTemplates; import static java.lang.Float.NaN; import static java.lang.Float.NaN; import com.android.systemui.Flags; import android.annotation.ColorInt; import android.annotation.ColorInt; import android.app.Notification; import android.app.Notification; import android.app.PendingIntent; import android.app.PendingIntent; Loading Loading @@ -32,6 +34,7 @@ import androidx.annotation.NonNull; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.ContrastColorUtil; import com.android.internal.util.ContrastColorUtil; import com.android.systemui.Flags; import com.android.systemui.res.R; import com.android.systemui.res.R; import com.android.systemui.statusbar.notification.NotificationUtils; import com.android.systemui.statusbar.notification.NotificationUtils; Loading Loading @@ -82,6 +85,7 @@ public class SmartReplyView extends ViewGroup { @ColorInt private int mCurrentBackgroundColor; @ColorInt private int mCurrentBackgroundColor; @ColorInt private final int mDefaultBackgroundColor; @ColorInt private final int mDefaultBackgroundColor; @ColorInt private final int mTransparentBackgroundColor; @ColorInt private final int mDefaultStrokeColor; @ColorInt private final int mDefaultStrokeColor; @ColorInt private final int mDefaultTextColor; @ColorInt private final int mDefaultTextColor; @ColorInt private final int mDefaultTextColorDarkBg; @ColorInt private final int mDefaultTextColorDarkBg; Loading Loading @@ -112,7 +116,13 @@ public class SmartReplyView extends ViewGroup { mHeightUpperLimit = NotificationUtils.getFontScaledHeight(mContext, mHeightUpperLimit = NotificationUtils.getFontScaledHeight(mContext, R.dimen.smart_reply_button_max_height); R.dimen.smart_reply_button_max_height); // The default color is white, as it helps us ensure ideal contrast. However, the actual // color will be based on the notification background (set in setBackgroundTintColor). // When notificationsRedesignTemplates is on, we use that color to calculate the colors of // the other elements, but we make the button transparent so that the translucent // background of the notification is visible. mDefaultBackgroundColor = context.getColor(R.color.smart_reply_button_background); mDefaultBackgroundColor = context.getColor(R.color.smart_reply_button_background); mTransparentBackgroundColor = context.getColor(R.color.transparent); mDefaultTextColor = mContext.getColor(R.color.smart_reply_button_text); mDefaultTextColor = mContext.getColor(R.color.smart_reply_button_text); mDefaultTextColorDarkBg = mContext.getColor(R.color.smart_reply_button_text_dark_bg); mDefaultTextColorDarkBg = mContext.getColor(R.color.smart_reply_button_text_dark_bg); mDefaultStrokeColor = mContext.getColor(R.color.smart_reply_button_stroke); mDefaultStrokeColor = mContext.getColor(R.color.smart_reply_button_stroke); Loading Loading @@ -833,7 +843,11 @@ public class SmartReplyView extends ViewGroup { Drawable background = ((InsetDrawable) inset).getDrawable(); Drawable background = ((InsetDrawable) inset).getDrawable(); if (background instanceof GradientDrawable) { if (background instanceof GradientDrawable) { GradientDrawable gradientDrawable = (GradientDrawable) background; GradientDrawable gradientDrawable = (GradientDrawable) background; gradientDrawable.setColor(mCurrentBackgroundColor); // With the redesign, we let the background be transparent (so the notification // surface gets through), but all other colors are calculated and applied // as usual to ensure contrast. gradientDrawable.setColor(notificationsRedesignTemplates() ? mTransparentBackgroundColor : mCurrentBackgroundColor); gradientDrawable.setStroke(mStrokeWidth, mCurrentStrokeColor); gradientDrawable.setStroke(mStrokeWidth, mCurrentStrokeColor); } } } } Loading Loading
packages/SystemUI/res/drawable/notification_2025_smart_reply_button_background.xml +1 −0 Original line number Original line Diff line number Diff line Loading @@ -28,6 +28,7 @@ android:insetBottom="8dp"> android:insetBottom="8dp"> <shape android:shape="rectangle"> <shape android:shape="rectangle"> <corners android:radius="@dimen/notification_2025_smart_reply_button_corner_radius" /> <corners android:radius="@dimen/notification_2025_smart_reply_button_corner_radius" /> <!-- Note that the stroke and fill colors are being overridden in SmartReplyView. --> <stroke android:width="@dimen/smart_reply_button_stroke_width" <stroke android:width="@dimen/smart_reply_button_stroke_width" android:color="@color/smart_reply_button_stroke" /> android:color="@color/smart_reply_button_stroke" /> <solid android:color="@color/smart_reply_button_background"/> <solid android:color="@color/smart_reply_button_background"/> Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java +16 −2 Original line number Original line Diff line number Diff line package com.android.systemui.statusbar.policy; package com.android.systemui.statusbar.policy; import static android.app.Flags.notificationsRedesignTemplates; import static java.lang.Float.NaN; import static java.lang.Float.NaN; import com.android.systemui.Flags; import android.annotation.ColorInt; import android.annotation.ColorInt; import android.app.Notification; import android.app.Notification; import android.app.PendingIntent; import android.app.PendingIntent; Loading Loading @@ -32,6 +34,7 @@ import androidx.annotation.NonNull; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.ContrastColorUtil; import com.android.internal.util.ContrastColorUtil; import com.android.systemui.Flags; import com.android.systemui.res.R; import com.android.systemui.res.R; import com.android.systemui.statusbar.notification.NotificationUtils; import com.android.systemui.statusbar.notification.NotificationUtils; Loading Loading @@ -82,6 +85,7 @@ public class SmartReplyView extends ViewGroup { @ColorInt private int mCurrentBackgroundColor; @ColorInt private int mCurrentBackgroundColor; @ColorInt private final int mDefaultBackgroundColor; @ColorInt private final int mDefaultBackgroundColor; @ColorInt private final int mTransparentBackgroundColor; @ColorInt private final int mDefaultStrokeColor; @ColorInt private final int mDefaultStrokeColor; @ColorInt private final int mDefaultTextColor; @ColorInt private final int mDefaultTextColor; @ColorInt private final int mDefaultTextColorDarkBg; @ColorInt private final int mDefaultTextColorDarkBg; Loading Loading @@ -112,7 +116,13 @@ public class SmartReplyView extends ViewGroup { mHeightUpperLimit = NotificationUtils.getFontScaledHeight(mContext, mHeightUpperLimit = NotificationUtils.getFontScaledHeight(mContext, R.dimen.smart_reply_button_max_height); R.dimen.smart_reply_button_max_height); // The default color is white, as it helps us ensure ideal contrast. However, the actual // color will be based on the notification background (set in setBackgroundTintColor). // When notificationsRedesignTemplates is on, we use that color to calculate the colors of // the other elements, but we make the button transparent so that the translucent // background of the notification is visible. mDefaultBackgroundColor = context.getColor(R.color.smart_reply_button_background); mDefaultBackgroundColor = context.getColor(R.color.smart_reply_button_background); mTransparentBackgroundColor = context.getColor(R.color.transparent); mDefaultTextColor = mContext.getColor(R.color.smart_reply_button_text); mDefaultTextColor = mContext.getColor(R.color.smart_reply_button_text); mDefaultTextColorDarkBg = mContext.getColor(R.color.smart_reply_button_text_dark_bg); mDefaultTextColorDarkBg = mContext.getColor(R.color.smart_reply_button_text_dark_bg); mDefaultStrokeColor = mContext.getColor(R.color.smart_reply_button_stroke); mDefaultStrokeColor = mContext.getColor(R.color.smart_reply_button_stroke); Loading Loading @@ -833,7 +843,11 @@ public class SmartReplyView extends ViewGroup { Drawable background = ((InsetDrawable) inset).getDrawable(); Drawable background = ((InsetDrawable) inset).getDrawable(); if (background instanceof GradientDrawable) { if (background instanceof GradientDrawable) { GradientDrawable gradientDrawable = (GradientDrawable) background; GradientDrawable gradientDrawable = (GradientDrawable) background; gradientDrawable.setColor(mCurrentBackgroundColor); // With the redesign, we let the background be transparent (so the notification // surface gets through), but all other colors are calculated and applied // as usual to ensure contrast. gradientDrawable.setColor(notificationsRedesignTemplates() ? mTransparentBackgroundColor : mCurrentBackgroundColor); gradientDrawable.setStroke(mStrokeWidth, mCurrentStrokeColor); gradientDrawable.setStroke(mStrokeWidth, mCurrentStrokeColor); } } } } Loading