Merge "Fix clock color option content description" into main
diff --git a/src/com/android/customization/picker/clock/ui/viewmodel/ClockSettingsViewModel.kt b/src/com/android/customization/picker/clock/ui/viewmodel/ClockSettingsViewModel.kt
index 2a93f27..52521d6 100644
--- a/src/com/android/customization/picker/clock/ui/viewmodel/ClockSettingsViewModel.kt
+++ b/src/com/android/customization/picker/clock/ui/viewmodel/ClockSettingsViewModel.kt
@@ -161,10 +161,11 @@
),
text =
Text.Loaded(
- context.getString(
- R.string.content_description_color_option,
- index,
- )
+ colorModel.colorName
+ ?: context.getString(
+ R.string.content_description_color_option,
+ index,
+ )
),
isTextUserVisible = false,
isSelected = isSelectedFlow,
@@ -180,7 +181,7 @@
color = colorModel.color,
colorTone =
colorModel.getColorTone(
- colorToneProgress,
+ colorToneProgress
),
)
clockPickerInteractor.setClockColor(
@@ -282,7 +283,7 @@
null
} else {
{ _selectedTabPosition.tryEmit(Tab.COLOR) }
- }
+ },
),
ClockSettingsTabViewModel(
name = context.resources.getString(R.string.clock_size),
@@ -292,7 +293,7 @@
null
} else {
{ _selectedTabPosition.tryEmit(Tab.SIZE) }
- }
+ },
),
)
}
@@ -302,11 +303,7 @@
fun blendColorWithTone(color: Int, colorTone: Double): Int {
ColorUtils.colorToLAB(color, helperColorLab)
- return ColorUtils.LABToColor(
- colorTone,
- helperColorLab[1],
- helperColorLab[2],
- )
+ return ColorUtils.LABToColor(colorTone, helperColorLab[1], helperColorLab[2])
}
const val COLOR_OPTIONS_EVENT_UPDATE_DELAY_MILLIS: Long = 100