Small fix for naming and boolean logic

Change-Id: I3dd291bdd581494574c557329bf23f5ed07af0bb
pull/542/head
Angie Sasmita 2 years ago
parent 19efc1b5e8
commit dbbe8ffecb

@ -112,7 +112,7 @@ class ThemeTest {
assertEquals(gradientColors, LocalGradientColors.current)
val backgroundTheme = defaultBackgroundTheme(colorScheme)
assertEquals(backgroundTheme, LocalBackgroundTheme.current)
val tintTheme = dynamicTintTheme(colorScheme)
val tintTheme = dynamicTintThemeWithFallback(colorScheme)
assertEquals(tintTheme, LocalTintTheme.current)
}
}
@ -132,7 +132,7 @@ class ThemeTest {
assertEquals(gradientColors, LocalGradientColors.current)
val backgroundTheme = defaultBackgroundTheme(colorScheme)
assertEquals(backgroundTheme, LocalBackgroundTheme.current)
val tintTheme = dynamicTintTheme(colorScheme)
val tintTheme = dynamicTintThemeWithFallback(colorScheme)
assertEquals(tintTheme, LocalTintTheme.current)
}
}
@ -267,7 +267,7 @@ class ThemeTest {
return TintTheme()
}
private fun dynamicTintTheme(colorScheme: ColorScheme): TintTheme {
private fun dynamicTintThemeWithFallback(colorScheme: ColorScheme): TintTheme {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
TintTheme(colorScheme.primary)
} else {

@ -98,7 +98,7 @@ fun SettingsDialog(
* height recalculation during recomposition. This, however, causes
* Dialog's to occupy full width in Compact mode. Therefore max width
* is configured below. This should be removed when there's fix to
* b/221643630
* https://issuetracker.google.com/issues/221643630
*/
AlertDialog(
properties = DialogProperties(usePlatformDefaultWidth = false),
@ -174,12 +174,12 @@ private fun SettingsPanel(
Column(Modifier.selectableGroup()) {
SettingsDialogThemeChooserRow(
text = stringResource(string.dynamic_color_yes),
selected = settings.useDynamicColor == true,
selected = settings.useDynamicColor,
onClick = { onChangeDynamicColorPreference(true) }
)
SettingsDialogThemeChooserRow(
text = stringResource(string.dynamic_color_no),
selected = settings.useDynamicColor == false,
selected = !settings.useDynamicColor,
onClick = { onChangeDynamicColorPreference(false) }
)
}

Loading…
Cancel
Save