mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Add option to quickly change to thumb images
This commit is contained in:
parent
70ad1ecdbf
commit
99b15f20c0
2 changed files with 40 additions and 9 deletions
|
|
@ -61,10 +61,27 @@ fun HomeRowSettings(
|
|||
},
|
||||
interactionSource = interactionSource,
|
||||
onClickPreference = { pref ->
|
||||
if (pref == Options.ViewOptionsReset) {
|
||||
onViewOptionsChange.invoke(defaultViewOptions)
|
||||
} else if (pref == Options.ViewOptionsApplyAll) {
|
||||
onApplyApplyAll.invoke()
|
||||
when (pref) {
|
||||
Options.ViewOptionsReset -> {
|
||||
onViewOptionsChange.invoke(defaultViewOptions)
|
||||
}
|
||||
|
||||
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 =
|
||||
|
|
@ -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,
|
||||
// ViewOptionsApplyAll,
|
||||
),
|
||||
),
|
||||
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,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue