Loading packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockProvider.kt +5 −4 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.systemui.plugins.clocks.ClockMetadata import com.android.systemui.plugins.clocks.ClockPickerConfig import com.android.systemui.plugins.clocks.ClockProvider import com.android.systemui.plugins.clocks.ClockSettings import com.android.systemui.shared.clocks.FlexClockController.Companion.AXIS_PRESETS import com.android.systemui.shared.clocks.FlexClockController.Companion.getDefaultAxes private val TAG = DefaultClockProvider::class.simpleName Loading Loading @@ -98,16 +99,16 @@ class DefaultClockProvider( throw IllegalArgumentException("${settings.clockId} is unsupported by $TAG") } val fontAxes = if (!isClockReactiveVariantsEnabled) listOf() else getDefaultAxes(settings).merge(settings.axes) return ClockPickerConfig( settings.clockId ?: DEFAULT_CLOCK_ID, resources.getString(R.string.clock_default_name), resources.getString(R.string.clock_default_description), resources.getDrawable(R.drawable.clock_default_thumbnail, null), isReactiveToTone = true, axes = fontAxes, axes = if (!isClockReactiveVariantsEnabled) emptyList() else getDefaultAxes(settings).merge(settings.axes), axisPresets = if (!isClockReactiveVariantsEnabled) emptyList() else AXIS_PRESETS, ) } Loading packages/SystemUI/customization/src/com/android/systemui/shared/clocks/FlexClockController.kt +55 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ class FlexClockController(private val clockCtx: ClockContext) : ClockController listOf( GSFAxes.WEIGHT.toClockAxis( type = AxisType.Float, currentValue = 400f, currentValue = 475f, name = "Weight", description = "Glyph Weight", ), Loading Loading @@ -161,5 +161,59 @@ class FlexClockController(private val clockCtx: ClockContext) : ClockController GSFAxes.ROUND.toClockAxisSetting(100f), GSFAxes.SLANT.toClockAxisSetting(0f), ) val AXIS_PRESETS = listOf( FONT_AXES.map { it.toSetting() }, LEGACY_FLEX_SETTINGS, listOf( // Porcelain GSFAxes.WEIGHT.toClockAxisSetting(500f), GSFAxes.WIDTH.toClockAxisSetting(100f), GSFAxes.ROUND.toClockAxisSetting(0f), GSFAxes.SLANT.toClockAxisSetting(0f), ), listOf( // Midnight GSFAxes.WEIGHT.toClockAxisSetting(300f), GSFAxes.WIDTH.toClockAxisSetting(100f), GSFAxes.ROUND.toClockAxisSetting(100f), GSFAxes.SLANT.toClockAxisSetting(-10f), ), listOf( // Sterling GSFAxes.WEIGHT.toClockAxisSetting(1000f), GSFAxes.WIDTH.toClockAxisSetting(100f), GSFAxes.ROUND.toClockAxisSetting(0f), GSFAxes.SLANT.toClockAxisSetting(0f), ), listOf( // Smoky Green GSFAxes.WEIGHT.toClockAxisSetting(150f), GSFAxes.WIDTH.toClockAxisSetting(50f), GSFAxes.ROUND.toClockAxisSetting(0f), GSFAxes.SLANT.toClockAxisSetting(0f), ), listOf( // Iris GSFAxes.WEIGHT.toClockAxisSetting(500f), GSFAxes.WIDTH.toClockAxisSetting(100f), GSFAxes.ROUND.toClockAxisSetting(100f), GSFAxes.SLANT.toClockAxisSetting(0f), ), listOf( // Margarita GSFAxes.WEIGHT.toClockAxisSetting(300f), GSFAxes.WIDTH.toClockAxisSetting(30f), GSFAxes.ROUND.toClockAxisSetting(100f), GSFAxes.SLANT.toClockAxisSetting(-10f), ), listOf( // Raspberry GSFAxes.WEIGHT.toClockAxisSetting(700f), GSFAxes.WIDTH.toClockAxisSetting(140f), GSFAxes.ROUND.toClockAxisSetting(100f), GSFAxes.SLANT.toClockAxisSetting(-7f), ), listOf( // Ultra Blue GSFAxes.WEIGHT.toClockAxisSetting(850f), GSFAxes.WIDTH.toClockAxisSetting(130f), GSFAxes.ROUND.toClockAxisSetting(0f), GSFAxes.SLANT.toClockAxisSetting(0f), ), ) } } packages/SystemUI/plugin/src/com/android/systemui/plugins/clocks/ClockPickerConfig.kt +3 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,9 @@ constructor( /** Font axes that can be modified on this clock */ val axes: List<ClockFontAxis> = listOf(), /** List of font presets for this clock. Can be assigned directly. */ val axisPresets: List<List<ClockFontAxisSetting>> = listOf(), ) /** Represents an Axis that can be modified */ Loading Loading
packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockProvider.kt +5 −4 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.systemui.plugins.clocks.ClockMetadata import com.android.systemui.plugins.clocks.ClockPickerConfig import com.android.systemui.plugins.clocks.ClockProvider import com.android.systemui.plugins.clocks.ClockSettings import com.android.systemui.shared.clocks.FlexClockController.Companion.AXIS_PRESETS import com.android.systemui.shared.clocks.FlexClockController.Companion.getDefaultAxes private val TAG = DefaultClockProvider::class.simpleName Loading Loading @@ -98,16 +99,16 @@ class DefaultClockProvider( throw IllegalArgumentException("${settings.clockId} is unsupported by $TAG") } val fontAxes = if (!isClockReactiveVariantsEnabled) listOf() else getDefaultAxes(settings).merge(settings.axes) return ClockPickerConfig( settings.clockId ?: DEFAULT_CLOCK_ID, resources.getString(R.string.clock_default_name), resources.getString(R.string.clock_default_description), resources.getDrawable(R.drawable.clock_default_thumbnail, null), isReactiveToTone = true, axes = fontAxes, axes = if (!isClockReactiveVariantsEnabled) emptyList() else getDefaultAxes(settings).merge(settings.axes), axisPresets = if (!isClockReactiveVariantsEnabled) emptyList() else AXIS_PRESETS, ) } Loading
packages/SystemUI/customization/src/com/android/systemui/shared/clocks/FlexClockController.kt +55 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,7 @@ class FlexClockController(private val clockCtx: ClockContext) : ClockController listOf( GSFAxes.WEIGHT.toClockAxis( type = AxisType.Float, currentValue = 400f, currentValue = 475f, name = "Weight", description = "Glyph Weight", ), Loading Loading @@ -161,5 +161,59 @@ class FlexClockController(private val clockCtx: ClockContext) : ClockController GSFAxes.ROUND.toClockAxisSetting(100f), GSFAxes.SLANT.toClockAxisSetting(0f), ) val AXIS_PRESETS = listOf( FONT_AXES.map { it.toSetting() }, LEGACY_FLEX_SETTINGS, listOf( // Porcelain GSFAxes.WEIGHT.toClockAxisSetting(500f), GSFAxes.WIDTH.toClockAxisSetting(100f), GSFAxes.ROUND.toClockAxisSetting(0f), GSFAxes.SLANT.toClockAxisSetting(0f), ), listOf( // Midnight GSFAxes.WEIGHT.toClockAxisSetting(300f), GSFAxes.WIDTH.toClockAxisSetting(100f), GSFAxes.ROUND.toClockAxisSetting(100f), GSFAxes.SLANT.toClockAxisSetting(-10f), ), listOf( // Sterling GSFAxes.WEIGHT.toClockAxisSetting(1000f), GSFAxes.WIDTH.toClockAxisSetting(100f), GSFAxes.ROUND.toClockAxisSetting(0f), GSFAxes.SLANT.toClockAxisSetting(0f), ), listOf( // Smoky Green GSFAxes.WEIGHT.toClockAxisSetting(150f), GSFAxes.WIDTH.toClockAxisSetting(50f), GSFAxes.ROUND.toClockAxisSetting(0f), GSFAxes.SLANT.toClockAxisSetting(0f), ), listOf( // Iris GSFAxes.WEIGHT.toClockAxisSetting(500f), GSFAxes.WIDTH.toClockAxisSetting(100f), GSFAxes.ROUND.toClockAxisSetting(100f), GSFAxes.SLANT.toClockAxisSetting(0f), ), listOf( // Margarita GSFAxes.WEIGHT.toClockAxisSetting(300f), GSFAxes.WIDTH.toClockAxisSetting(30f), GSFAxes.ROUND.toClockAxisSetting(100f), GSFAxes.SLANT.toClockAxisSetting(-10f), ), listOf( // Raspberry GSFAxes.WEIGHT.toClockAxisSetting(700f), GSFAxes.WIDTH.toClockAxisSetting(140f), GSFAxes.ROUND.toClockAxisSetting(100f), GSFAxes.SLANT.toClockAxisSetting(-7f), ), listOf( // Ultra Blue GSFAxes.WEIGHT.toClockAxisSetting(850f), GSFAxes.WIDTH.toClockAxisSetting(130f), GSFAxes.ROUND.toClockAxisSetting(0f), GSFAxes.SLANT.toClockAxisSetting(0f), ), ) } }
packages/SystemUI/plugin/src/com/android/systemui/plugins/clocks/ClockPickerConfig.kt +3 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,9 @@ constructor( /** Font axes that can be modified on this clock */ val axes: List<ClockFontAxis> = listOf(), /** List of font presets for this clock. Can be assigned directly. */ val axisPresets: List<List<ClockFontAxisSetting>> = listOf(), ) /** Represents an Axis that can be modified */ Loading