Loading packages/SystemUI/customization/src/com/android/systemui/shared/clocks/ComposedDigitalLayerController.kt +1 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ class ComposedDigitalLayerController(private val clockCtx: ClockContext) : override fun onThemeChanged(theme: ThemeConfig) { view.updateColor( lockscreenColor = theme.getDefaultColor(clockCtx.context), aodColor = clockCtx.resources.getColor(android.R.color.system_accent1_100), aodColor = theme.getAodColor(clockCtx.context), ) } Loading packages/SystemUI/customization/src/com/android/systemui/shared/clocks/SimpleDigitalHandLayerController.kt +4 −19 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.widget.RelativeLayout import androidx.annotation.VisibleForTesting import com.android.systemui.animation.TextAnimator import com.android.systemui.log.core.Logger import com.android.systemui.monet.ColorScheme import com.android.systemui.plugins.clocks.AlarmData import com.android.systemui.plugins.clocks.ClockAnimations import com.android.systemui.plugins.clocks.ClockAxisStyle Loading @@ -34,7 +33,6 @@ import com.android.systemui.plugins.clocks.ClockViewIds import com.android.systemui.plugins.clocks.ThemeConfig import com.android.systemui.plugins.clocks.WeatherData import com.android.systemui.plugins.clocks.ZenData import com.android.systemui.shared.Flags.ambientAod import com.android.systemui.shared.clocks.view.HorizontalAlignment import com.android.systemui.shared.clocks.view.SimpleDigitalClockTextView import com.android.systemui.shared.clocks.view.VerticalAlignment Loading Loading @@ -226,23 +224,10 @@ open class SimpleDigitalHandLayerController( } override fun onThemeChanged(theme: ThemeConfig) { if (ambientAod()) { val aodColor = theme.seedColor?.let { val colorScheme = ColorScheme( it, false, // darkTheme is not used for palette generation ) colorScheme.accent1.s100 } ?: clockCtx.resources.getColor(android.R.color.system_accent1_100) view.updateColor( lockscreenColor = theme.getDefaultColor(clockCtx.context), aodColor = aodColor, aodColor = theme.getAodColor(clockCtx.context), ) } else { view.updateColor(lockscreenColor = theme.getDefaultColor(clockCtx.context)) } refreshTime() } Loading packages/SystemUI/customization/src/com/android/systemui/shared/clocks/view/FlexClockView.kt +2 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.shared.clocks.view import android.graphics.Canvas import android.graphics.Color import android.icu.text.NumberFormat import android.util.MathUtils.constrainedMap import android.view.View Loading Loading @@ -267,7 +268,7 @@ class FlexClockView(clockCtx: ClockContext) : ViewGroup(clockCtx.context) { requestLayout() } fun updateColor(lockscreenColor: Int, aodColor: Int) { fun updateColor(lockscreenColor: Int, aodColor: Int = Color.WHITE) { childViews.forEach { view -> view.updateColor(lockscreenColor, aodColor) } invalidate() } Loading packages/SystemUI/plugin/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ java_library { "androidx.annotation_annotation", "androidx.compose.ui_ui", "androidx.compose.runtime_runtime", "monet", ], } Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/clocks/ClockFaceEvents.kt +18 −0 Original line number Diff line number Diff line Loading @@ -14,8 +14,11 @@ package com.android.systemui.plugins.clocks import android.content.Context import android.graphics.Color import android.graphics.Rect import com.android.systemui.monet.ColorScheme import com.android.systemui.plugins.annotations.ProtectedInterface import com.android.systemui.shared.Flags.ambientAod /** Events that have specific data about the related face */ @ProtectedInterface Loading Loading @@ -70,4 +73,19 @@ data class ThemeConfig( else -> context.resources.getColor(android.R.color.system_accent2_600) } } fun getAodColor(context: Context): Int { return if (!ambientAod()) { Color.WHITE } else { seedColor?.let { val colorScheme = ColorScheme( it, false, // darkTheme is not used for palette generation ) colorScheme.accent1.s100 } ?: context.resources.getColor(android.R.color.system_accent1_100) } } } Loading
packages/SystemUI/customization/src/com/android/systemui/shared/clocks/ComposedDigitalLayerController.kt +1 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ class ComposedDigitalLayerController(private val clockCtx: ClockContext) : override fun onThemeChanged(theme: ThemeConfig) { view.updateColor( lockscreenColor = theme.getDefaultColor(clockCtx.context), aodColor = clockCtx.resources.getColor(android.R.color.system_accent1_100), aodColor = theme.getAodColor(clockCtx.context), ) } Loading
packages/SystemUI/customization/src/com/android/systemui/shared/clocks/SimpleDigitalHandLayerController.kt +4 −19 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.widget.RelativeLayout import androidx.annotation.VisibleForTesting import com.android.systemui.animation.TextAnimator import com.android.systemui.log.core.Logger import com.android.systemui.monet.ColorScheme import com.android.systemui.plugins.clocks.AlarmData import com.android.systemui.plugins.clocks.ClockAnimations import com.android.systemui.plugins.clocks.ClockAxisStyle Loading @@ -34,7 +33,6 @@ import com.android.systemui.plugins.clocks.ClockViewIds import com.android.systemui.plugins.clocks.ThemeConfig import com.android.systemui.plugins.clocks.WeatherData import com.android.systemui.plugins.clocks.ZenData import com.android.systemui.shared.Flags.ambientAod import com.android.systemui.shared.clocks.view.HorizontalAlignment import com.android.systemui.shared.clocks.view.SimpleDigitalClockTextView import com.android.systemui.shared.clocks.view.VerticalAlignment Loading Loading @@ -226,23 +224,10 @@ open class SimpleDigitalHandLayerController( } override fun onThemeChanged(theme: ThemeConfig) { if (ambientAod()) { val aodColor = theme.seedColor?.let { val colorScheme = ColorScheme( it, false, // darkTheme is not used for palette generation ) colorScheme.accent1.s100 } ?: clockCtx.resources.getColor(android.R.color.system_accent1_100) view.updateColor( lockscreenColor = theme.getDefaultColor(clockCtx.context), aodColor = aodColor, aodColor = theme.getAodColor(clockCtx.context), ) } else { view.updateColor(lockscreenColor = theme.getDefaultColor(clockCtx.context)) } refreshTime() } Loading
packages/SystemUI/customization/src/com/android/systemui/shared/clocks/view/FlexClockView.kt +2 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.shared.clocks.view import android.graphics.Canvas import android.graphics.Color import android.icu.text.NumberFormat import android.util.MathUtils.constrainedMap import android.view.View Loading Loading @@ -267,7 +268,7 @@ class FlexClockView(clockCtx: ClockContext) : ViewGroup(clockCtx.context) { requestLayout() } fun updateColor(lockscreenColor: Int, aodColor: Int) { fun updateColor(lockscreenColor: Int, aodColor: Int = Color.WHITE) { childViews.forEach { view -> view.updateColor(lockscreenColor, aodColor) } invalidate() } Loading
packages/SystemUI/plugin/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ java_library { "androidx.annotation_annotation", "androidx.compose.ui_ui", "androidx.compose.runtime_runtime", "monet", ], } Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/clocks/ClockFaceEvents.kt +18 −0 Original line number Diff line number Diff line Loading @@ -14,8 +14,11 @@ package com.android.systemui.plugins.clocks import android.content.Context import android.graphics.Color import android.graphics.Rect import com.android.systemui.monet.ColorScheme import com.android.systemui.plugins.annotations.ProtectedInterface import com.android.systemui.shared.Flags.ambientAod /** Events that have specific data about the related face */ @ProtectedInterface Loading Loading @@ -70,4 +73,19 @@ data class ThemeConfig( else -> context.resources.getColor(android.R.color.system_accent2_600) } } fun getAodColor(context: Context): Int { return if (!ambientAod()) { Color.WHITE } else { seedColor?.let { val colorScheme = ColorScheme( it, false, // darkTheme is not used for palette generation ) colorScheme.accent1.s100 } ?: context.resources.getColor(android.R.color.system_accent1_100) } } }