Loading packages/SystemUI/compose/core/src/com/android/compose/theme/AndroidColorScheme.kt +8 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,10 @@ class AndroidColorScheme( val underSurface: Color, val weatherTemp: Color, val widgetBackground: Color, val surfaceEffect0: Color, val surfaceEffect1: Color, val surfaceEffect2: Color, val surfaceEffect3: Color, ) { companion object { internal fun color(context: Context, @ColorRes id: Int): Color { Loading Loading @@ -123,6 +127,10 @@ class AndroidColorScheme( underSurface = color(context, R.color.customColorUnderSurface), weatherTemp = color(context, R.color.customColorWeatherTemp), widgetBackground = color(context, R.color.customColorWidgetBackground), surfaceEffect0 = color(context, R.color.surface_effect_0), surfaceEffect1 = color(context, R.color.surface_effect_1), surfaceEffect2 = color(context, R.color.surface_effect_2), surfaceEffect3 = color(context, R.color.surface_effect_3), ) } } Loading packages/SystemUI/src/com/android/systemui/common/shared/colors/SurfaceEffectColors.kt +13 −9 Original line number Diff line number Diff line Loading @@ -16,23 +16,27 @@ package com.android.systemui.common.shared.colors import android.content.res.Resources import android.content.Context object SurfaceEffectColors { @JvmStatic fun surfaceEffect0(r: Resources): Int { return r.getColor(com.android.internal.R.color.surface_effect_0) fun surfaceEffect0(context: Context): Int { return context.resources.getColor( com.android.internal.R.color.surface_effect_0, context.theme) } @JvmStatic fun surfaceEffect1(r: Resources): Int { return r.getColor(com.android.internal.R.color.surface_effect_1) fun surfaceEffect1(context: Context): Int { return context.resources.getColor( com.android.internal.R.color.surface_effect_1, context.theme) } @JvmStatic fun surfaceEffect2(r: Resources): Int { return r.getColor(com.android.internal.R.color.surface_effect_2) fun surfaceEffect2(context: Context): Int { return context.resources.getColor( com.android.internal.R.color.surface_effect_2, context.theme) } @JvmStatic fun surfaceEffect3(r: Resources): Int { return r.getColor(com.android.internal.R.color.surface_effect_3) fun surfaceEffect3(context: Context): Int { return context.resources.getColor( com.android.internal.R.color.surface_effect_3, context.theme) } } packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterView.java +1 −1 Original line number Diff line number Diff line Loading @@ -391,7 +391,7 @@ public class FooterView extends StackScrollerDecorView { if (!notificationFooterBackgroundTintOptimization()) { if (notificationShadeBlur()) { Color backgroundColor = Color.valueOf( SurfaceEffectColors.surfaceEffect1(getResources())); SurfaceEffectColors.surfaceEffect1(getContext())); scHigh = ColorUtils.setAlphaComponent(backgroundColor.toArgb(), 0xFF); // Apply alpha on background drawables. int backgroundAlpha = (int) (backgroundColor.alpha() * 0xFF); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java +1 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView private void updateColors() { if (notificationRowTransparency()) { mNormalColor = SurfaceEffectColors.surfaceEffect1(getResources()); mNormalColor = SurfaceEffectColors.surfaceEffect1(getContext()); } else { mNormalColor = mContext.getColor( com.android.internal.R.color.materialColorSurfaceContainerHigh); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationBackgroundView.java +2 −2 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ public class NotificationBackgroundView extends View implements Dumpable, mDarkColoredStatefulColors = getResources().getColorStateList( R.color.notification_state_color_dark); if (notificationRowTransparency()) { mNormalColor = SurfaceEffectColors.surfaceEffect1(getResources()); mNormalColor = SurfaceEffectColors.surfaceEffect1(getContext()); } else { mNormalColor = mContext.getColor( com.android.internal.R.color.materialColorSurfaceContainerHigh); Loading Loading @@ -321,7 +321,7 @@ public class NotificationBackgroundView extends View implements Dumpable, new PorterDuffColorFilter( isColorized() ? ColorUtils.setAlphaComponent(mTintColor, (int) (255 * 0.9f)) : SurfaceEffectColors.surfaceEffect1(getResources()), : SurfaceEffectColors.surfaceEffect1(getContext()), PorterDuff.Mode.SRC)); // SRC operator discards the drawable's color+alpha } Loading Loading
packages/SystemUI/compose/core/src/com/android/compose/theme/AndroidColorScheme.kt +8 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,10 @@ class AndroidColorScheme( val underSurface: Color, val weatherTemp: Color, val widgetBackground: Color, val surfaceEffect0: Color, val surfaceEffect1: Color, val surfaceEffect2: Color, val surfaceEffect3: Color, ) { companion object { internal fun color(context: Context, @ColorRes id: Int): Color { Loading Loading @@ -123,6 +127,10 @@ class AndroidColorScheme( underSurface = color(context, R.color.customColorUnderSurface), weatherTemp = color(context, R.color.customColorWeatherTemp), widgetBackground = color(context, R.color.customColorWidgetBackground), surfaceEffect0 = color(context, R.color.surface_effect_0), surfaceEffect1 = color(context, R.color.surface_effect_1), surfaceEffect2 = color(context, R.color.surface_effect_2), surfaceEffect3 = color(context, R.color.surface_effect_3), ) } } Loading
packages/SystemUI/src/com/android/systemui/common/shared/colors/SurfaceEffectColors.kt +13 −9 Original line number Diff line number Diff line Loading @@ -16,23 +16,27 @@ package com.android.systemui.common.shared.colors import android.content.res.Resources import android.content.Context object SurfaceEffectColors { @JvmStatic fun surfaceEffect0(r: Resources): Int { return r.getColor(com.android.internal.R.color.surface_effect_0) fun surfaceEffect0(context: Context): Int { return context.resources.getColor( com.android.internal.R.color.surface_effect_0, context.theme) } @JvmStatic fun surfaceEffect1(r: Resources): Int { return r.getColor(com.android.internal.R.color.surface_effect_1) fun surfaceEffect1(context: Context): Int { return context.resources.getColor( com.android.internal.R.color.surface_effect_1, context.theme) } @JvmStatic fun surfaceEffect2(r: Resources): Int { return r.getColor(com.android.internal.R.color.surface_effect_2) fun surfaceEffect2(context: Context): Int { return context.resources.getColor( com.android.internal.R.color.surface_effect_2, context.theme) } @JvmStatic fun surfaceEffect3(r: Resources): Int { return r.getColor(com.android.internal.R.color.surface_effect_3) fun surfaceEffect3(context: Context): Int { return context.resources.getColor( com.android.internal.R.color.surface_effect_3, context.theme) } }
packages/SystemUI/src/com/android/systemui/statusbar/notification/footer/ui/view/FooterView.java +1 −1 Original line number Diff line number Diff line Loading @@ -391,7 +391,7 @@ public class FooterView extends StackScrollerDecorView { if (!notificationFooterBackgroundTintOptimization()) { if (notificationShadeBlur()) { Color backgroundColor = Color.valueOf( SurfaceEffectColors.surfaceEffect1(getResources())); SurfaceEffectColors.surfaceEffect1(getContext())); scHigh = ColorUtils.setAlphaComponent(backgroundColor.toArgb(), 0xFF); // Apply alpha on background drawables. int backgroundAlpha = (int) (backgroundColor.alpha() * 0xFF); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationView.java +1 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView private void updateColors() { if (notificationRowTransparency()) { mNormalColor = SurfaceEffectColors.surfaceEffect1(getResources()); mNormalColor = SurfaceEffectColors.surfaceEffect1(getContext()); } else { mNormalColor = mContext.getColor( com.android.internal.R.color.materialColorSurfaceContainerHigh); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationBackgroundView.java +2 −2 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ public class NotificationBackgroundView extends View implements Dumpable, mDarkColoredStatefulColors = getResources().getColorStateList( R.color.notification_state_color_dark); if (notificationRowTransparency()) { mNormalColor = SurfaceEffectColors.surfaceEffect1(getResources()); mNormalColor = SurfaceEffectColors.surfaceEffect1(getContext()); } else { mNormalColor = mContext.getColor( com.android.internal.R.color.materialColorSurfaceContainerHigh); Loading Loading @@ -321,7 +321,7 @@ public class NotificationBackgroundView extends View implements Dumpable, new PorterDuffColorFilter( isColorized() ? ColorUtils.setAlphaComponent(mTintColor, (int) (255 * 0.9f)) : SurfaceEffectColors.surfaceEffect1(getResources()), : SurfaceEffectColors.surfaceEffect1(getContext()), PorterDuff.Mode.SRC)); // SRC operator discards the drawable's color+alpha } Loading