mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Disable discover & use different settings for genre rows
This commit is contained in:
parent
44a08f27c1
commit
43fde88695
3 changed files with 19 additions and 6 deletions
|
|
@ -37,9 +37,11 @@ fun HomeRowSettings(
|
|||
viewOptions: HomeRowViewOptions,
|
||||
onViewOptionsChange: (HomeRowViewOptions) -> Unit,
|
||||
onApplyApplyAll: () -> Unit,
|
||||
userGenreSettings: Boolean,
|
||||
modifier: Modifier = Modifier,
|
||||
defaultViewOptions: HomeRowViewOptions = HomeRowViewOptions(),
|
||||
) {
|
||||
val options = if (userGenreSettings) Options.GENRE_OPTIONS else Options.OPTIONS
|
||||
val firstFocus = remember { FocusRequester() }
|
||||
LaunchedEffect(Unit) { firstFocus.tryRequestFocus() }
|
||||
Column(modifier = modifier) {
|
||||
|
|
@ -49,7 +51,7 @@ fun HomeRowSettings(
|
|||
color = MaterialTheme.colorScheme.onSurface,
|
||||
)
|
||||
LazyColumn {
|
||||
itemsIndexed(Options.OPTIONS) { index, pref ->
|
||||
itemsIndexed(options) { index, pref ->
|
||||
pref as AppPreference<HomeRowViewOptions, Any>
|
||||
val interactionSource = remember { MutableInteractionSource() }
|
||||
val value = pref.getter.invoke(viewOptions)
|
||||
|
|
@ -82,7 +84,7 @@ fun HomeRowSettings(
|
|||
}
|
||||
|
||||
internal object Options {
|
||||
val ViewOptionsColumns =
|
||||
val ViewOptionsCardHeight =
|
||||
AppSliderPreference<HomeRowViewOptions>(
|
||||
title = R.string.height,
|
||||
defaultValue = Cards.HEIGHT_2X3_DP.toLong(),
|
||||
|
|
@ -176,10 +178,17 @@ internal object Options {
|
|||
// TODO
|
||||
// ViewOptionsShowTitles,
|
||||
ViewOptionsUseSeries,
|
||||
ViewOptionsColumns,
|
||||
ViewOptionsCardHeight,
|
||||
ViewOptionsSpacing,
|
||||
ViewOptionsContentScale,
|
||||
// ViewOptionsApplyAll,
|
||||
ViewOptionsReset,
|
||||
)
|
||||
|
||||
val GENRE_OPTIONS =
|
||||
listOf(
|
||||
ViewOptionsCardHeight,
|
||||
ViewOptionsSpacing,
|
||||
ViewOptionsReset,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ fun HomeSettingsFavoriteList(
|
|||
}
|
||||
}
|
||||
|
||||
val favoriteOptions =
|
||||
val favoriteOptions by lazy {
|
||||
mapOf(
|
||||
BaseItemKind.MOVIE to R.string.movies,
|
||||
BaseItemKind.SERIES to R.string.tv_shows,
|
||||
|
|
@ -65,4 +65,5 @@ val favoriteOptions =
|
|||
BaseItemKind.PLAYLIST to R.string.playlists,
|
||||
BaseItemKind.PERSON to R.string.people,
|
||||
)
|
||||
val favoriteOptionsList = favoriteOptions.keys.toList()
|
||||
}
|
||||
val favoriteOptionsList by lazy { favoriteOptions.keys.toList() }
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import androidx.navigation3.ui.NavDisplay
|
|||
import androidx.tv.material3.MaterialTheme
|
||||
import androidx.tv.material3.surfaceColorAtElevation
|
||||
import com.github.damontecres.wholphin.R
|
||||
import com.github.damontecres.wholphin.data.model.HomeRowConfig
|
||||
import com.github.damontecres.wholphin.ui.components.ConfirmDialog
|
||||
import com.github.damontecres.wholphin.ui.main.HomePageContent
|
||||
import com.github.damontecres.wholphin.ui.main.settings.HomeSettingsDestination.ChooseRowType
|
||||
|
|
@ -50,7 +51,8 @@ fun HomeSettingsPage(
|
|||
var showConfirmDialog by remember { mutableStateOf<(() -> Unit)?>(null) }
|
||||
|
||||
val state by viewModel.state.collectAsState()
|
||||
val discoverEnabled by viewModel.discoverEnabled.collectAsState(false)
|
||||
// TODO discover rows
|
||||
val discoverEnabled = false // by viewModel.discoverEnabled.collectAsState(false)
|
||||
|
||||
// Adds a row, waits until its done loading, then scrolls to the new row
|
||||
fun addRow(func: () -> Job) {
|
||||
|
|
@ -157,6 +159,7 @@ fun HomeSettingsPage(
|
|||
onApplyApplyAll = {
|
||||
viewModel.updateViewOptionsForAll(row.config.viewOptions)
|
||||
},
|
||||
userGenreSettings = row.config is HomeRowConfig.Genres,
|
||||
modifier = destModifier,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue