Hide toggle effect descriptions when enabled in non-individual scheduling
When wallpaper effects are toggled on and individual scheduling is off, hide the description text for a cleaner UI: - Grayscale effect - Adaptive brightness - Shuffle Changes: - Make SettingSwitch description parameter nullable - Conditionally hide description when: - Effect is enabled (checked = true) - AND individual scheduling is OFF (separateSchedules = false) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
9820581723
commit
ca59cd8155
3 files changed
+20
-13
No files matched your search
@@ -6,7 +6,8 @@
|
|||||||
"Bash(git push:*)",
|
"Bash(git push:*)",
|
||||||
"WebFetch(domain:github.com)",
|
"WebFetch(domain:github.com)",
|
||||||
"WebFetch(domain:raw.githubusercontent.com)",
|
"WebFetch(domain:raw.githubusercontent.com)",
|
||||||
"Bash(dir:*)"
|
"Bash(dir:*)",
|
||||||
|
"Bash(./gradlew assembleDebug:*)"
|
||||||
],
|
],
|
||||||
"deny": [],
|
"deny": [],
|
||||||
"ask": []
|
"ask": []
|
||||||
|
|||||||
+7
-3
@@ -645,7 +645,11 @@ fun WallpaperScreen(
|
|||||||
// Grayscale
|
// Grayscale
|
||||||
SettingSwitch(
|
SettingSwitch(
|
||||||
title = R.string.gray_filter,
|
title = R.string.gray_filter,
|
||||||
description = R.string.make_the_colors_grayscale,
|
description = if (when {
|
||||||
|
homeEnabled && lockEnabled -> scheduleSettings.homeEffects.enableGrayscale && scheduleSettings.lockEffects.enableGrayscale
|
||||||
|
homeEnabled -> scheduleSettings.homeEffects.enableGrayscale
|
||||||
|
else -> scheduleSettings.lockEffects.enableGrayscale
|
||||||
|
} && !scheduleSettings.separateSchedules) null else R.string.make_the_colors_grayscale,
|
||||||
checked = when {
|
checked = when {
|
||||||
homeEnabled && lockEnabled -> scheduleSettings.homeEffects.enableGrayscale && scheduleSettings.lockEffects.enableGrayscale
|
homeEnabled && lockEnabled -> scheduleSettings.homeEffects.enableGrayscale && scheduleSettings.lockEffects.enableGrayscale
|
||||||
homeEnabled -> scheduleSettings.homeEffects.enableGrayscale
|
homeEnabled -> scheduleSettings.homeEffects.enableGrayscale
|
||||||
@@ -664,7 +668,7 @@ fun WallpaperScreen(
|
|||||||
// Adaptive Brightness
|
// Adaptive Brightness
|
||||||
SettingSwitch(
|
SettingSwitch(
|
||||||
title = R.string.adaptive_brightness,
|
title = R.string.adaptive_brightness,
|
||||||
description = R.string.adjust_brightness_based_on_mode,
|
description = if (scheduleSettings.adaptiveBrightness && !scheduleSettings.separateSchedules) null else R.string.adjust_brightness_based_on_mode,
|
||||||
checked = scheduleSettings.adaptiveBrightness,
|
checked = scheduleSettings.adaptiveBrightness,
|
||||||
onCheckedChange = { enabled ->
|
onCheckedChange = { enabled ->
|
||||||
onUpdateScheduleSettings(scheduleSettings.copy(adaptiveBrightness = enabled))
|
onUpdateScheduleSettings(scheduleSettings.copy(adaptiveBrightness = enabled))
|
||||||
@@ -674,7 +678,7 @@ fun WallpaperScreen(
|
|||||||
// Shuffle
|
// Shuffle
|
||||||
SettingSwitch(
|
SettingSwitch(
|
||||||
title = R.string.shuffle,
|
title = R.string.shuffle,
|
||||||
description = R.string.randomly_shuffle_the_wallpapers,
|
description = if (scheduleSettings.shuffleEnabled && !scheduleSettings.separateSchedules) null else R.string.randomly_shuffle_the_wallpapers,
|
||||||
checked = scheduleSettings.shuffleEnabled,
|
checked = scheduleSettings.shuffleEnabled,
|
||||||
onCheckedChange = { enabled ->
|
onCheckedChange = { enabled ->
|
||||||
onUpdateScheduleSettings(scheduleSettings.copy(shuffleEnabled = enabled))
|
onUpdateScheduleSettings(scheduleSettings.copy(shuffleEnabled = enabled))
|
||||||
|
|||||||
+11
-9
@@ -29,7 +29,7 @@ import com.anthonyla.paperize.presentation.theme.AppSpacing
|
|||||||
@Composable
|
@Composable
|
||||||
fun SettingSwitch(
|
fun SettingSwitch(
|
||||||
@StringRes title: Int,
|
@StringRes title: Int,
|
||||||
@StringRes description: Int,
|
@StringRes description: Int?,
|
||||||
checked: Boolean,
|
checked: Boolean,
|
||||||
onCheckedChange: (Boolean) -> Unit,
|
onCheckedChange: (Boolean) -> Unit,
|
||||||
modifier: Modifier = Modifier
|
modifier: Modifier = Modifier
|
||||||
@@ -61,14 +61,16 @@ fun SettingSwitch(
|
|||||||
maxLines = 2,
|
maxLines = 2,
|
||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Ellipsis
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(AppSpacing.extraSmall))
|
description?.let {
|
||||||
Text(
|
Spacer(modifier = Modifier.height(AppSpacing.extraSmall))
|
||||||
text = stringResource(description),
|
Text(
|
||||||
style = MaterialTheme.typography.bodySmall,
|
text = stringResource(it),
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
style = MaterialTheme.typography.bodySmall,
|
||||||
maxLines = 3,
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
overflow = TextOverflow.Ellipsis
|
maxLines = 3,
|
||||||
)
|
overflow = TextOverflow.Ellipsis
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.width(AppSpacing.large))
|
Spacer(modifier = Modifier.width(AppSpacing.large))
|
||||||
Switch(
|
Switch(
|
||||||
|
|||||||
Reference in new issue
Block a user