Add option to quickly change to thumb images

This commit is contained in:
Damontecres 2026-02-05 12:32:04 -05:00
parent 70ad1ecdbf
commit 99b15f20c0
No known key found for this signature in database
2 changed files with 40 additions and 9 deletions

View file

@ -61,11 +61,28 @@ fun HomeRowSettings(
},
interactionSource = interactionSource,
onClickPreference = { pref ->
if (pref == Options.ViewOptionsReset) {
when (pref) {
Options.ViewOptionsReset -> {
onViewOptionsChange.invoke(defaultViewOptions)
} else if (pref == Options.ViewOptionsApplyAll) {
}
Options.ViewOptionsApplyAll -> {
onApplyApplyAll.invoke()
}
Options.ViewOptionsUseThumb -> {
onViewOptionsChange.invoke(
HomeRowViewOptions(
heightDp = Cards.HEIGHT_EPISODE,
spacing = 20,
imageType = ViewOptionImageType.THUMB,
aspectRatio = AspectRatio.WIDE,
episodeImageType = ViewOptionImageType.THUMB,
episodeAspectRatio = AspectRatio.WIDE,
),
)
}
}
},
modifier =
Modifier
@ -168,6 +185,11 @@ internal object Options {
title = R.string.reset,
)
val ViewOptionsUseThumb =
AppClickablePreference<HomeRowViewOptions>(
title = R.string.use_thumb_images,
)
val ViewOptionsEpisodeContentScale =
AppChoicePreference<HomeRowViewOptions, PrefContentScale>(
title = R.string.global_content_scale,
@ -184,7 +206,7 @@ internal object Options {
title = R.string.aspect_ratio,
defaultValue = AspectRatio.TALL,
displayValues = R.array.aspect_ratios,
getter = { it.aspectRatio },
getter = { it.episodeAspectRatio },
setter = { viewOptions, value -> viewOptions.copy(episodeAspectRatio = value) },
indexToValue = { AspectRatio.entries[it] },
valueToIndex = { it.ordinal },
@ -214,15 +236,22 @@ internal object Options {
title = R.string.general,
preferences =
listOf(
ViewOptionsCardHeight,
ViewOptionsSpacing,
ViewOptionsImageType,
ViewOptionsAspectRatio,
ViewOptionsContentScale,
// TODO
// ViewOptionsShowTitles,
ViewOptionsUseSeries,
ViewOptionsCardHeight,
ViewOptionsSpacing,
ViewOptionsContentScale,
),
),
PreferenceGroup(
title = R.string.more,
preferences =
listOf(
// ViewOptionsApplyAll,
ViewOptionsUseThumb,
ViewOptionsReset,
),
),
@ -255,6 +284,7 @@ internal object Options {
title = R.string.more,
preferences =
listOf(
ViewOptionsUseThumb,
ViewOptionsReset,
),
),

View file

@ -503,6 +503,7 @@
<string name="suggestions_for">Suggestions for %1$s</string>
<string name="increase_all_cards_size">Increase all cards size</string>
<string name="decrease_all_cards_size">Decrease all cards size</string>
<string name="use_thumb_images">Use thumb images</string>
<string-array name="theme_song_volume">
<item>Disabled</item>