mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-19 08:45:27 +02:00
Fix dynamic theme option visibility on old devices
This commit is contained in:
parent
50f0ddbe91
commit
daf921c702
@ -225,6 +225,8 @@ private fun ThemesScreen(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
|
||||||
|
item { Header(stringResource(R.string.color_scheme)) }
|
||||||
|
|
||||||
item {
|
item {
|
||||||
UnittoListItem(
|
UnittoListItem(
|
||||||
leadingContent = {
|
leadingContent = {
|
||||||
@ -239,50 +241,50 @@ private fun ThemesScreen(
|
|||||||
onSwitchChange = onDynamicThemeChange
|
onSwitchChange = onDynamicThemeChange
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
item {
|
item {
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
visible = !isDynamicThemeEnabled,
|
visible = !isDynamicThemeEnabled,
|
||||||
enter = expandVertically() + fadeIn(),
|
enter = expandVertically() + fadeIn(),
|
||||||
exit = shrinkVertically() + fadeOut(),
|
exit = shrinkVertically() + fadeOut(),
|
||||||
) {
|
) {
|
||||||
ListItem(
|
ListItem(
|
||||||
headlineContent = { Text(stringResource(R.string.selected_color)) },
|
headlineContent = { Text(stringResource(R.string.selected_color)) },
|
||||||
supportingContent = {
|
supportingContent = {
|
||||||
ColorSelector(
|
ColorSelector(
|
||||||
modifier = Modifier.padding(top = 12.dp),
|
modifier = Modifier.padding(top = 12.dp),
|
||||||
selected = selectedColor,
|
selected = selectedColor,
|
||||||
onItemClick = onColorChange,
|
onItemClick = onColorChange,
|
||||||
colorSchemes = colorSchemes,
|
colorSchemes = colorSchemes,
|
||||||
defaultColor = Color(0xFF186c31)
|
defaultColor = Color(0xFF186c31)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
modifier = Modifier.padding(start = 40.dp)
|
modifier = Modifier.padding(start = 40.dp)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
item {
|
item {
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
visible = (!isDynamicThemeEnabled) and (selectedColor != Color.Unspecified),
|
visible = (!isDynamicThemeEnabled) and (selectedColor != Color.Unspecified),
|
||||||
enter = expandVertically() + fadeIn(),
|
enter = expandVertically() + fadeIn(),
|
||||||
exit = shrinkVertically() + fadeOut(),
|
exit = shrinkVertically() + fadeOut(),
|
||||||
) {
|
) {
|
||||||
ListItem(
|
ListItem(
|
||||||
headlineContent = { Text(stringResource(R.string.monet_mode)) },
|
headlineContent = { Text(stringResource(R.string.monet_mode)) },
|
||||||
supportingContent = {
|
supportingContent = {
|
||||||
MonetModeSelector(
|
MonetModeSelector(
|
||||||
modifier = Modifier.padding(top = 12.dp),
|
modifier = Modifier.padding(top = 12.dp),
|
||||||
selected = monetMode,
|
selected = monetMode,
|
||||||
onItemClick = onMonetModeChange,
|
onItemClick = onMonetModeChange,
|
||||||
monetModes = remember { MonetMode.values().toList() },
|
monetModes = remember { MonetMode.values().toList() },
|
||||||
customColor = selectedColor,
|
customColor = selectedColor,
|
||||||
themingMode = currentThemingMode,
|
themingMode = currentThemingMode,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
modifier = Modifier.padding(start = 40.dp)
|
modifier = Modifier.padding(start = 40.dp)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user