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

View file

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