mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Use app preferences
This commit is contained in:
parent
3dd78f175b
commit
9e876a85d4
18 changed files with 146 additions and 45 deletions
|
|
@ -3,6 +3,7 @@ package com.github.damontecres.dolphin
|
|||
import android.os.Bundle
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.size
|
||||
|
|
@ -57,7 +58,10 @@ class MainActivity : AppCompatActivity() {
|
|||
val scope = rememberCoroutineScope()
|
||||
DolphinTheme(true) {
|
||||
Surface(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
modifier =
|
||||
Modifier
|
||||
.fillMaxSize()
|
||||
.background(MaterialTheme.colorScheme.background),
|
||||
shape = RectangleShape,
|
||||
) {
|
||||
CoilConfig(serverRepository, okHttpClient, false)
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
package com.github.damontecres.dolphin.ui.preferences
|
||||
package com.github.damontecres.dolphin.preferences
|
||||
|
||||
import android.content.Context
|
||||
import androidx.annotation.ArrayRes
|
||||
import androidx.annotation.StringRes
|
||||
import com.github.damontecres.dolphin.R
|
||||
import com.github.damontecres.dolphin.preferences.AppPreferences
|
||||
import com.github.damontecres.dolphin.preferences.updatePlaybackPreferences
|
||||
import com.github.damontecres.dolphin.ui.nav.Destination
|
||||
import com.github.damontecres.dolphin.ui.preferences.PreferenceGroup
|
||||
import com.github.damontecres.dolphin.ui.preferences.PreferenceValidation
|
||||
import kotlin.time.Duration.Companion.milliseconds
|
||||
import kotlin.time.Duration.Companion.minutes
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
|
@ -149,6 +149,32 @@ sealed interface AppPreference<T> {
|
|||
summarizer = { value -> value?.toString() },
|
||||
)
|
||||
|
||||
val HomePageItems =
|
||||
AppSliderPreference(
|
||||
title = R.string.max_homepage_items,
|
||||
defaultValue = 25,
|
||||
min = 5,
|
||||
max = 50,
|
||||
interval = 1,
|
||||
getter = { it.homePagePreferences.maxItemsPerRow.toLong() },
|
||||
setter = { prefs, value ->
|
||||
prefs.updateHomePagePreferences { maxItemsPerRow = value.toInt() }
|
||||
},
|
||||
summarizer = { value -> value?.toString() },
|
||||
)
|
||||
|
||||
val RewatchNextUp =
|
||||
AppSwitchPreference(
|
||||
title = R.string.rewatch_next_up,
|
||||
defaultValue = false,
|
||||
getter = { it.homePagePreferences.enableRewatchingNextUp },
|
||||
setter = { prefs, value ->
|
||||
prefs.updateHomePagePreferences { enableRewatchingNextUp = value }
|
||||
},
|
||||
summaryOn = R.string.enabled,
|
||||
summaryOff = R.string.disabled,
|
||||
)
|
||||
|
||||
// val PlaybackDebugInfo =
|
||||
// AppSwitchPreference(
|
||||
// title = R.string.playback_debug_info,
|
||||
|
|
@ -194,6 +220,26 @@ sealed interface AppPreference<T> {
|
|||
}
|
||||
}
|
||||
|
||||
val basicPreferences =
|
||||
listOf(
|
||||
PreferenceGroup(
|
||||
title = R.string.basic_interface,
|
||||
preferences =
|
||||
listOf(
|
||||
AppPreference.SkipForward,
|
||||
AppPreference.SkipBack,
|
||||
AppPreference.ControllerTimeout,
|
||||
AppPreference.SeekBarSteps,
|
||||
AppPreference.HomePageItems,
|
||||
AppPreference.RewatchNextUp,
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
val uiPreferences = listOf<PreferenceGroup>()
|
||||
|
||||
val advancedPreferences = listOf<PreferenceGroup>()
|
||||
|
||||
data class AppSwitchPreference(
|
||||
@get:StringRes override val title: Int,
|
||||
override val defaultValue: Boolean,
|
||||
|
|
@ -2,7 +2,6 @@ package com.github.damontecres.dolphin.preferences
|
|||
|
||||
import androidx.datastore.core.CorruptionException
|
||||
import androidx.datastore.core.Serializer
|
||||
import com.github.damontecres.dolphin.ui.preferences.AppPreference
|
||||
import com.google.protobuf.InvalidProtocolBufferException
|
||||
import java.io.InputStream
|
||||
import java.io.OutputStream
|
||||
|
|
@ -27,6 +26,13 @@ class AppPreferencesSerializer
|
|||
controllerTimeoutMs = AppPreference.ControllerTimeout.defaultValue
|
||||
seekBarSteps = AppPreference.SeekBarSteps.defaultValue.toInt()
|
||||
}.build()
|
||||
homePagePreferences =
|
||||
HomePagePreferences
|
||||
.newBuilder()
|
||||
.apply {
|
||||
maxItemsPerRow = AppPreference.HomePageItems.defaultValue.toInt()
|
||||
enableRewatchingNextUp = AppPreference.RewatchNextUp.defaultValue
|
||||
}.build()
|
||||
}.build()
|
||||
|
||||
override suspend fun readFrom(input: InputStream): AppPreferences {
|
||||
|
|
@ -49,3 +55,8 @@ inline fun AppPreferences.updatePlaybackPreferences(block: PlaybackPreferences.B
|
|||
update {
|
||||
playbackPreferences = playbackPreferences.toBuilder().apply(block).build()
|
||||
}
|
||||
|
||||
inline fun AppPreferences.updateHomePagePreferences(block: HomePagePreferences.Builder.() -> Unit): AppPreferences =
|
||||
update {
|
||||
homePagePreferences = homePagePreferences.toBuilder().apply(block).build()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import androidx.compose.ui.focus.onFocusChanged
|
|||
import androidx.compose.ui.input.key.onPreviewKeyEvent
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.media3.common.Player
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import org.jellyfin.sdk.model.api.BaseItemDto
|
||||
import org.jellyfin.sdk.model.extensions.ticks
|
||||
|
|
@ -181,3 +182,7 @@ val BaseItemDto.timeRemaining: Duration?
|
|||
null
|
||||
}
|
||||
}
|
||||
|
||||
fun Player.seekBack(amount: Duration) = seekTo((currentPosition - amount.inWholeMilliseconds).coerceAtLeast(0L))
|
||||
|
||||
fun Player.seekForward(amount: Duration) = seekTo((currentPosition + amount.inWholeMilliseconds).coerceAtMost(duration))
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ import androidx.tv.material3.Text
|
|||
import coil3.compose.AsyncImage
|
||||
import com.github.damontecres.dolphin.data.model.BaseItem
|
||||
import com.github.damontecres.dolphin.preferences.UserPreferences
|
||||
import com.github.damontecres.dolphin.ui.OneTimeLaunchedEffect
|
||||
import com.github.damontecres.dolphin.ui.cards.BannerCard
|
||||
import com.github.damontecres.dolphin.ui.cards.ItemRow
|
||||
import com.github.damontecres.dolphin.ui.components.CircularProgress
|
||||
|
|
@ -67,6 +68,9 @@ fun MainPage(
|
|||
modifier: Modifier,
|
||||
viewModel: MainViewModel = hiltViewModel(),
|
||||
) {
|
||||
OneTimeLaunchedEffect {
|
||||
viewModel.init(preferences)
|
||||
}
|
||||
val loading by viewModel.loadingState.observeAsState(LoadingState.Loading)
|
||||
when (val state = loading) {
|
||||
is LoadingState.Error -> Text(text = "Error: ${state.message}", modifier = modifier)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import androidx.lifecycle.MutableLiveData
|
|||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.github.damontecres.dolphin.data.model.BaseItem
|
||||
import com.github.damontecres.dolphin.preferences.UserPreferences
|
||||
import com.github.damontecres.dolphin.ui.DefaultItemFields
|
||||
import com.github.damontecres.dolphin.ui.isNotNullOrBlank
|
||||
import com.github.damontecres.dolphin.util.ExceptionHandler
|
||||
|
|
@ -34,7 +35,8 @@ class MainViewModel
|
|||
val loadingState = MutableLiveData<LoadingState>(LoadingState.Loading)
|
||||
val homeRows = MutableLiveData<List<HomeRow>>()
|
||||
|
||||
init {
|
||||
fun init(preferences: UserPreferences) {
|
||||
val limit = preferences.appPreferences.homePagePreferences.maxItemsPerRow
|
||||
viewModelScope.launch(ExceptionHandler() + Dispatchers.IO) {
|
||||
val user = api.userApi.getCurrentUser().content
|
||||
val displayPrefs =
|
||||
|
|
@ -74,7 +76,7 @@ class MainViewModel
|
|||
imageTypeLimit = 1,
|
||||
parentId = viewId,
|
||||
groupItems = true,
|
||||
limit = 25,
|
||||
limit = limit,
|
||||
)
|
||||
val latest =
|
||||
api.userLibraryApi
|
||||
|
|
@ -94,6 +96,7 @@ class MainViewModel
|
|||
GetResumeItemsRequest(
|
||||
userId = user.id,
|
||||
fields = DefaultItemFields,
|
||||
limit = limit,
|
||||
// TODO, more params?
|
||||
)
|
||||
val items =
|
||||
|
|
@ -116,8 +119,10 @@ class MainViewModel
|
|||
fields = DefaultItemFields,
|
||||
imageTypeLimit = 1,
|
||||
parentId = null,
|
||||
limit = 25,
|
||||
limit = limit,
|
||||
enableResumable = false,
|
||||
enableUserData = true,
|
||||
enableRewatching = preferences.appPreferences.homePagePreferences.enableRewatchingNextUp,
|
||||
)
|
||||
val nextUp =
|
||||
api.tvShowsApi
|
||||
|
|
|
|||
|
|
@ -109,8 +109,7 @@ fun NavDrawer(
|
|||
NavigationDrawer(
|
||||
modifier =
|
||||
modifier
|
||||
.focusRequester(drawerFocusRequester)
|
||||
.background(MaterialTheme.colorScheme.background),
|
||||
.focusRequester(drawerFocusRequester),
|
||||
drawerState = drawerState,
|
||||
drawerContent = {
|
||||
ProvideTextStyle(MaterialTheme.typography.labelMedium) {
|
||||
|
|
|
|||
|
|
@ -12,14 +12,14 @@ import kotlinx.coroutines.flow.debounce
|
|||
|
||||
class ControllerViewState internal constructor(
|
||||
@param:IntRange(from = 0)
|
||||
private val hideMilliseconds: Int,
|
||||
private val hideMilliseconds: Long,
|
||||
val controlsEnabled: Boolean,
|
||||
) {
|
||||
private val channel = Channel<Int>(CONFLATED)
|
||||
private val channel = Channel<Long>(CONFLATED)
|
||||
private var _controlsVisible by mutableStateOf(false)
|
||||
val controlsVisible get() = _controlsVisible
|
||||
|
||||
fun showControls(milliseconds: Int = hideMilliseconds) {
|
||||
fun showControls(milliseconds: Long = hideMilliseconds) {
|
||||
if (controlsEnabled) {
|
||||
_controlsVisible = true
|
||||
}
|
||||
|
|
@ -30,7 +30,7 @@ class ControllerViewState internal constructor(
|
|||
_controlsVisible = false
|
||||
}
|
||||
|
||||
fun pulseControls(milliseconds: Int = hideMilliseconds) {
|
||||
fun pulseControls(milliseconds: Long = hideMilliseconds) {
|
||||
channel.trySend(milliseconds)
|
||||
}
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ class ControllerViewState internal constructor(
|
|||
suspend fun observe() {
|
||||
channel
|
||||
.consumeAsFlow()
|
||||
.debounce { it.toLong() }
|
||||
.debounce { it }
|
||||
.collect {
|
||||
_controlsVisible = false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ fun PlaybackContent(
|
|||
val controllerViewState =
|
||||
remember {
|
||||
ControllerViewState(
|
||||
5_000,
|
||||
preferences.appPreferences.playbackPreferences.controllerTimeoutMs,
|
||||
true,
|
||||
)
|
||||
}.also {
|
||||
|
|
@ -124,6 +124,8 @@ fun PlaybackContent(
|
|||
player = player,
|
||||
controlsEnabled = true,
|
||||
skipWithLeftRight = true,
|
||||
seekForward = preferences.appPreferences.playbackPreferences.skipForwardMs.milliseconds,
|
||||
seekBack = preferences.appPreferences.playbackPreferences.skipBackMs.milliseconds,
|
||||
controllerViewState = controllerViewState,
|
||||
updateSkipIndicator = updateSkipIndicator,
|
||||
)
|
||||
|
|
@ -199,6 +201,8 @@ fun PlaybackContent(
|
|||
previousEnabled = previousState.isEnabled,
|
||||
nextEnabled = nextState.isEnabled,
|
||||
seekEnabled = true,
|
||||
seekForward = preferences.appPreferences.playbackPreferences.skipForwardMs.milliseconds,
|
||||
seekBack = preferences.appPreferences.playbackPreferences.skipBackMs.milliseconds,
|
||||
onPlaybackActionClick = {
|
||||
when (it) {
|
||||
is PlaybackAction.PlaybackSpeed -> {
|
||||
|
|
|
|||
|
|
@ -58,12 +58,15 @@ import androidx.tv.material3.MaterialTheme
|
|||
import androidx.tv.material3.Text
|
||||
import com.github.damontecres.dolphin.R
|
||||
import com.github.damontecres.dolphin.ui.AppColors
|
||||
import com.github.damontecres.dolphin.ui.seekBack
|
||||
import com.github.damontecres.dolphin.ui.seekForward
|
||||
import com.github.damontecres.dolphin.ui.tryRequestFocus
|
||||
import com.github.damontecres.dolphin.util.ExceptionHandler
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.isActive
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import kotlin.time.Duration
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
sealed interface PlaybackAction {
|
||||
|
|
@ -110,6 +113,8 @@ fun PlaybackControls(
|
|||
playbackSpeed: Float,
|
||||
scale: ContentScale,
|
||||
seekBarIntervals: Int,
|
||||
seekBack: Duration,
|
||||
seekForward: Duration,
|
||||
modifier: Modifier = Modifier,
|
||||
initialFocusRequester: FocusRequester = remember { FocusRequester() },
|
||||
seekBarInteractionSource: MutableInteractionSource = remember { MutableInteractionSource() },
|
||||
|
|
@ -127,7 +132,7 @@ fun PlaybackControls(
|
|||
scope.launch(ExceptionHandler()) {
|
||||
bringIntoViewRequester.bringIntoView()
|
||||
}
|
||||
controllerViewState.pulseControls(Int.MAX_VALUE)
|
||||
controllerViewState.pulseControls(Long.MAX_VALUE)
|
||||
}
|
||||
LaunchedEffect(controllerViewState.controlsVisible) {
|
||||
if (controllerViewState.controlsVisible) {
|
||||
|
|
@ -170,6 +175,8 @@ fun PlaybackControls(
|
|||
showPlay = showPlay,
|
||||
previousEnabled = previousEnabled,
|
||||
nextEnabled = nextEnabled,
|
||||
seekBack = seekBack,
|
||||
seekForward = seekForward,
|
||||
modifier = Modifier.align(Alignment.Center),
|
||||
)
|
||||
RightPlaybackButtons(
|
||||
|
|
@ -430,6 +437,8 @@ fun PlaybackButtons(
|
|||
showPlay: Boolean,
|
||||
previousEnabled: Boolean,
|
||||
nextEnabled: Boolean,
|
||||
seekBack: Duration,
|
||||
seekForward: Duration,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Row(
|
||||
|
|
@ -449,7 +458,7 @@ fun PlaybackButtons(
|
|||
iconRes = R.drawable.baseline_fast_rewind_24,
|
||||
onClick = {
|
||||
onControllerInteraction.invoke()
|
||||
player.seekBack()
|
||||
player.seekBack(seekBack)
|
||||
},
|
||||
onControllerInteraction = onControllerInteraction,
|
||||
)
|
||||
|
|
@ -466,7 +475,7 @@ fun PlaybackButtons(
|
|||
iconRes = R.drawable.baseline_fast_forward_24,
|
||||
onClick = {
|
||||
onControllerInteraction.invoke()
|
||||
player.seekForward()
|
||||
player.seekForward(seekForward)
|
||||
},
|
||||
onControllerInteraction = onControllerInteraction,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -7,11 +7,16 @@ import androidx.compose.ui.input.key.key
|
|||
import androidx.compose.ui.input.key.type
|
||||
import androidx.media3.common.Player
|
||||
import androidx.media3.common.util.Util
|
||||
import com.github.damontecres.dolphin.ui.seekBack
|
||||
import com.github.damontecres.dolphin.ui.seekForward
|
||||
import kotlin.time.Duration
|
||||
|
||||
class PlaybackKeyHandler(
|
||||
private val player: Player,
|
||||
private val controlsEnabled: Boolean,
|
||||
private val skipWithLeftRight: Boolean,
|
||||
private val seekBack: Duration,
|
||||
private val seekForward: Duration,
|
||||
private val controllerViewState: ControllerViewState,
|
||||
private val updateSkipIndicator: (Long) -> Unit,
|
||||
) {
|
||||
|
|
@ -24,11 +29,11 @@ class PlaybackKeyHandler(
|
|||
} else if (isDpad(it)) {
|
||||
if (!controllerViewState.controlsVisible) {
|
||||
if (skipWithLeftRight && it.key == Key.DirectionLeft) {
|
||||
updateSkipIndicator(-player.seekBackIncrement)
|
||||
player.seekBack()
|
||||
updateSkipIndicator(-seekBack.inWholeMilliseconds)
|
||||
player.seekBack(seekBack)
|
||||
} else if (skipWithLeftRight && it.key == Key.DirectionRight) {
|
||||
player.seekForward()
|
||||
updateSkipIndicator(player.seekForwardIncrement)
|
||||
player.seekForward(seekForward)
|
||||
updateSkipIndicator(seekForward.inWholeMilliseconds)
|
||||
} else {
|
||||
controllerViewState.showControls()
|
||||
}
|
||||
|
|
@ -54,13 +59,13 @@ class PlaybackKeyHandler(
|
|||
}
|
||||
|
||||
Key.MediaFastForward, Key.MediaSkipForward -> {
|
||||
player.seekForward()
|
||||
updateSkipIndicator(player.seekForwardIncrement)
|
||||
player.seekForward(seekForward)
|
||||
updateSkipIndicator(seekForward.inWholeMilliseconds)
|
||||
}
|
||||
|
||||
Key.MediaRewind, Key.MediaSkipBackward -> {
|
||||
player.seekBack()
|
||||
updateSkipIndicator(-player.seekBackIncrement)
|
||||
player.seekBack(seekBack)
|
||||
updateSkipIndicator(-seekBack.inWholeMilliseconds)
|
||||
}
|
||||
|
||||
Key.MediaNext -> if (player.isCommandAvailable(Player.COMMAND_SEEK_TO_NEXT)) player.seekToNext()
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import androidx.compose.ui.layout.ContentScale
|
|||
import androidx.media3.common.Player
|
||||
import androidx.tv.material3.Text
|
||||
import org.jellyfin.sdk.model.api.TrickplayInfo
|
||||
import kotlin.time.Duration
|
||||
|
||||
@Composable
|
||||
fun PlaybackOverlay(
|
||||
|
|
@ -29,6 +30,8 @@ fun PlaybackOverlay(
|
|||
previousEnabled: Boolean,
|
||||
nextEnabled: Boolean,
|
||||
seekEnabled: Boolean,
|
||||
seekBack: Duration,
|
||||
seekForward: Duration,
|
||||
onPlaybackActionClick: (PlaybackAction) -> Unit,
|
||||
onSeekBarChange: (Long) -> Unit,
|
||||
showDebugInfo: Boolean,
|
||||
|
|
@ -121,6 +124,8 @@ fun PlaybackOverlay(
|
|||
playbackSpeed = playbackSpeed,
|
||||
scale = scale,
|
||||
seekBarIntervals = 16,
|
||||
seekBack = seekBack,
|
||||
seekForward = seekForward,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,14 @@ import androidx.tv.material3.Switch
|
|||
import androidx.tv.material3.Text
|
||||
import androidx.tv.material3.surfaceColorAtElevation
|
||||
import com.github.damontecres.dolphin.R
|
||||
import com.github.damontecres.dolphin.preferences.AppChoicePreference
|
||||
import com.github.damontecres.dolphin.preferences.AppClickablePreference
|
||||
import com.github.damontecres.dolphin.preferences.AppDestinationPreference
|
||||
import com.github.damontecres.dolphin.preferences.AppMultiChoicePreference
|
||||
import com.github.damontecres.dolphin.preferences.AppPreference
|
||||
import com.github.damontecres.dolphin.preferences.AppSliderPreference
|
||||
import com.github.damontecres.dolphin.preferences.AppStringPreference
|
||||
import com.github.damontecres.dolphin.preferences.AppSwitchPreference
|
||||
import com.github.damontecres.dolphin.ui.components.DialogItem
|
||||
import com.github.damontecres.dolphin.ui.components.DialogParams
|
||||
import com.github.damontecres.dolphin.ui.components.DialogPopup
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.github.damontecres.dolphin.ui.preferences
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
import com.github.damontecres.dolphin.preferences.AppPreference
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -38,7 +38,11 @@ import androidx.tv.material3.MaterialTheme
|
|||
import androidx.tv.material3.Text
|
||||
import androidx.tv.material3.surfaceColorAtElevation
|
||||
import com.github.damontecres.dolphin.R
|
||||
import com.github.damontecres.dolphin.preferences.AppPreference
|
||||
import com.github.damontecres.dolphin.preferences.AppPreferences
|
||||
import com.github.damontecres.dolphin.preferences.advancedPreferences
|
||||
import com.github.damontecres.dolphin.preferences.basicPreferences
|
||||
import com.github.damontecres.dolphin.preferences.uiPreferences
|
||||
import com.github.damontecres.dolphin.ui.ifElse
|
||||
import com.github.damontecres.dolphin.ui.nav.NavigationManager
|
||||
import com.github.damontecres.dolphin.ui.playOnClickSound
|
||||
|
|
@ -47,24 +51,6 @@ import com.github.damontecres.dolphin.ui.tryRequestFocus
|
|||
import com.github.damontecres.dolphin.util.ExceptionHandler
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
val basicPreferences =
|
||||
listOf(
|
||||
PreferenceGroup(
|
||||
title = R.string.basic_interface,
|
||||
preferences =
|
||||
listOf(
|
||||
AppPreference.SkipForward,
|
||||
AppPreference.SkipBack,
|
||||
AppPreference.ControllerTimeout,
|
||||
AppPreference.SeekBarSteps,
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
val uiPreferences = listOf<PreferenceGroup>()
|
||||
|
||||
val advancedPreferences = listOf<PreferenceGroup>()
|
||||
|
||||
data class Release(
|
||||
val version: String,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import androidx.compose.ui.unit.dp
|
|||
import androidx.tv.material3.MaterialTheme
|
||||
import androidx.tv.material3.ProvideTextStyle
|
||||
import androidx.tv.material3.contentColorFor
|
||||
import com.github.damontecres.dolphin.preferences.AppSliderPreference
|
||||
import com.github.damontecres.dolphin.ui.components.SliderBar
|
||||
|
||||
@Composable
|
||||
|
|
|
|||
|
|
@ -10,10 +10,16 @@ message PlaybackPreferences {
|
|||
int32 seek_bar_steps = 4;
|
||||
}
|
||||
|
||||
message HomePagePreferences{
|
||||
int32 max_items_per_row = 1;
|
||||
bool enable_rewatching_next_up = 2;
|
||||
}
|
||||
|
||||
message AppPreferences {
|
||||
// The currently signed in server and user IDs, mostly for restoring a session
|
||||
string current_server_id = 1;
|
||||
string current_user_id = 2;
|
||||
|
||||
PlaybackPreferences playback_preferences = 3;
|
||||
HomePagePreferences home_page_preferences = 4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,4 +36,6 @@
|
|||
<string name="skip_back_preference">Skip back</string>
|
||||
<string name="hide_controller_timeout">Hide playback controls</string>
|
||||
<string name="seek_bar_steps">Seek bar steps</string>
|
||||
<string name="max_homepage_items">Max items on home page rows</string>
|
||||
<string name="rewatch_next_up">Enable rewatching in next up</string>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue