Skip to content

Commit

Permalink
Fixing selected theme item background not updating when theme mode ch…
Browse files Browse the repository at this point in the history
…anges
  • Loading branch information
savvasdalkitsis committed Dec 13, 2024
1 parent 2fbb26b commit ccb8ff3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fun Checkable(
content: @Composable BoxScope.() -> Unit,
) {
val scale = remember(id) { Animatable(1f) }
val backgroundColor = remember(selectionMode) {
val backgroundColor = remember(selectionMode, selectionBackgroundColor) {
when (selectionMode) {
SelectionMode.SELECTED -> selectionBackgroundColor
else -> fallbackColor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,12 @@ private fun ThemeItem(
state: ThemeSettingsState,
onThemeVariantChanged: (ThemeVariant, ThemeContrast) -> Unit = { _, _ -> },
) {
val selectionBackgroundColor = MaterialTheme.colorScheme.surfaceContainerHigh
ContentTheme(
themeMode = state.themeMode,
theme = themeVariant,
themeContrast = themeContrast,
) {
Checkable(
selectionBackgroundColor = selectionBackgroundColor,
id = themeVariant.label,
shape = CardDefaults.outlinedShape,
selectedBorder = CardDefaults.outlinedCardBorder(),
Expand Down

0 comments on commit ccb8ff3

Please sign in to comment.