Add option for dpad skipping with no seek bar (#1742)
## Description Adds a third option for d-pad seeking to not show any seek bar which only shows the skip indicator and not the seek bar along the bottom ### Related issues Original work to add other mode in #1650 Closes #1520 ### Testing Emulator testing ## Screenshots <img width="546" height="347" alt="image" src="https://github.com/user-attachments/assets/2872566e-4598-4284-92cb-95a45b307835" /> ## AI or LLM usage None
This commit is contained in:
parent
cf3c00a1e1
commit
26a23d673b
5 changed files with 26 additions and 13 deletions
|
|
@ -664,7 +664,7 @@ sealed interface AppPreference<Pref, T> {
|
|||
val DpadSeekModePref =
|
||||
AppChoicePreference<AppPreferences, DpadSeekMode>(
|
||||
title = R.string.d_pad_seek_mode_title,
|
||||
defaultValue = DpadSeekMode.SKIP_TIME,
|
||||
defaultValue = DpadSeekMode.SEEKBAR_MINIMAL,
|
||||
getter = { it.playbackPreferences.dpadSeekMode },
|
||||
setter = { prefs, value ->
|
||||
prefs.updatePlaybackPreferences { dpadSeekMode = value }
|
||||
|
|
@ -672,6 +672,7 @@ sealed interface AppPreference<Pref, T> {
|
|||
displayValues = R.array.dpad_seek_mode_options,
|
||||
indexToValue = { DpadSeekMode.forNumber(it) },
|
||||
valueToIndex = { if (it != DpadSeekMode.UNRECOGNIZED) it.number else 0 },
|
||||
subtitles = R.array.dpad_seek_mode_summaries,
|
||||
)
|
||||
|
||||
val GlobalContentScale =
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ class PlaybackKeyHandler(
|
|||
|
||||
private fun seekBy(duration: Duration) {
|
||||
val durationMs = duration.inWholeMilliseconds
|
||||
if (dpadSeekMode == DpadSeekMode.TRICKPLAY) {
|
||||
if (dpadSeekMode == DpadSeekMode.SEEKBAR_TRICKPLAY) {
|
||||
onDpadSeek.invoke(durationMs)
|
||||
} else {
|
||||
if (duration < Duration.ZERO) {
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ fun PlaybackPageContent(
|
|||
},
|
||||
onPlaybackDialogTypeClick = { playbackDialog = it },
|
||||
isDpadSeekVisible = {
|
||||
prefs.dpadSeekMode == DpadSeekMode.TRICKPLAY && skipIndicatorDuration != 0L
|
||||
prefs.dpadSeekMode == DpadSeekMode.SEEKBAR_TRICKPLAY && skipIndicatorDuration != 0L
|
||||
},
|
||||
onDpadSeek = onDpadSeek,
|
||||
dpadSeekMode = prefs.dpadSeekMode,
|
||||
|
|
@ -382,7 +382,7 @@ fun PlaybackPageContent(
|
|||
visible =
|
||||
!controllerViewState.controlsVisible &&
|
||||
skipIndicatorDuration != 0L &&
|
||||
prefs.dpadSeekMode == DpadSeekMode.TRICKPLAY,
|
||||
prefs.dpadSeekMode == DpadSeekMode.SEEKBAR_TRICKPLAY,
|
||||
enter = fadeIn() + slideInVertically { it / 2 },
|
||||
exit = fadeOut() + slideOutVertically { it },
|
||||
modifier =
|
||||
|
|
@ -408,7 +408,9 @@ fun PlaybackPageContent(
|
|||
}
|
||||
|
||||
// If D-pad skipping, show the amount skipped in an animation
|
||||
if (!controllerViewState.controlsVisible && skipIndicatorDuration != 0L && prefs.dpadSeekMode != DpadSeekMode.TRICKPLAY) {
|
||||
if (!controllerViewState.controlsVisible && skipIndicatorDuration != 0L &&
|
||||
prefs.dpadSeekMode != DpadSeekMode.SEEKBAR_TRICKPLAY
|
||||
) {
|
||||
// Skip time mode: show seek distance indicator
|
||||
SkipIndicator(
|
||||
durationMs = skipIndicatorDuration,
|
||||
|
|
@ -421,8 +423,7 @@ fun PlaybackPageContent(
|
|||
.padding(bottom = 70.dp),
|
||||
)
|
||||
// Show a small progress bar along the bottom of the screen
|
||||
val showSkipProgress = true // TODO get from preferences
|
||||
if (showSkipProgress) {
|
||||
if (prefs.dpadSeekMode == DpadSeekMode.SEEKBAR_MINIMAL) {
|
||||
val percent = skipPosition.toFloat() / player.duration.toFloat()
|
||||
Box(
|
||||
modifier =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue