Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c657000 authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Revert "Consolidate clock color logic"

Revert submission 31920138-mpietal_clock_color

Reason for revert: frameworks/base/packages/SystemUI/multivalentTests/src/com/android/systemui/shared/clocks/DefaultClockProviderTest.kt:115:40: error: type mismatch: inferred type is () -> Unit but ClockEventListener? was expected
clock.initialize(true, 0f, 0f, {})

Reverted changes: /q/submissionid:31920138-mpietal_clock_color

Change-Id: I86709f1f4c7042a64c1abb1da16dd0980aa7509c
parent 2f4a95b9
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ data class AxisDefinition(
)

object GSFAxes {
    @JvmStatic
    val WEIGHT =
        AxisDefinition(
            tag = "wght",
+0 −1
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ interface TypefaceVariantCache {
    fun getTypefaceForVariant(fvar: String?): Typeface?

    companion object {
        @JvmStatic
        fun createVariantTypeface(baseTypeface: Typeface, fVar: String?): Typeface {
            if (fVar.isNullOrEmpty()) {
                return baseTypeface
+9 −1
Original line number Diff line number Diff line
@@ -161,7 +161,15 @@ class ComposedDigitalLayerController(private val clockCtx: ClockContext) :
            }

            override fun onThemeChanged(theme: ThemeConfig) {
                view.updateColor(theme.getDefaultColor(clockCtx.context))
                val color =
                    when {
                        theme.seedColor != null -> theme.seedColor!!
                        theme.isDarkTheme ->
                            clockCtx.resources.getColor(android.R.color.system_accent1_100)
                        else -> clockCtx.resources.getColor(android.R.color.system_accent2_600)
                    }

                view.updateColor(color)
            }

            override fun onFontSettingChanged(fontSizePx: Float) {
+8 −1
Original line number Diff line number Diff line
@@ -149,7 +149,14 @@ class DefaultClockController(
                override fun onThemeChanged(theme: ThemeConfig) {
                    this@DefaultClockFaceController.theme = theme

                    val color = theme.getDefaultColor(ctx)
                    val color =
                        when {
                            theme.seedColor != null -> theme.seedColor!!
                            theme.isDarkTheme ->
                                resources.getColor(android.R.color.system_accent1_100)
                            else -> resources.getColor(android.R.color.system_accent2_600)
                        }

                    if (currentColor == color) {
                        return
                    }
+9 −1
Original line number Diff line number Diff line
@@ -229,7 +229,15 @@ open class SimpleDigitalHandLayerController(
            }

            override fun onThemeChanged(theme: ThemeConfig) {
                view.updateColor(theme.getDefaultColor(clockCtx.context))
                val color =
                    when {
                        theme.seedColor != null -> theme.seedColor!!
                        theme.isDarkTheme ->
                            clockCtx.resources.getColor(android.R.color.system_accent1_100)
                        else -> clockCtx.resources.getColor(android.R.color.system_accent2_600)
                    }

                view.updateColor(color)
                refreshTime()
            }

Loading