Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -664,14 +664,15 @@ 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 }
},
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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 =
Expand All @@ -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,
Expand All @@ -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 =
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/proto/WholphinDataStore.proto
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ message PlaybackPreferences {
}

enum DpadSeekMode {
SKIP_TIME = 0;
TRICKPLAY = 1;
SEEKBAR_MINIMAL = 0;
SEEKBAR_TRICKPLAY = 1;
SEEKBAR_NONE = 2;
}

message HomePagePreferences{
Expand Down
18 changes: 14 additions & 4 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,6 @@
<string name="add_to_playlist">Add to playlist</string>
<string name="one_click_pause">Pause with one click</string>
<string name="one_click_pause_summary_on">Press D-Pad center to pause/play</string>
<string name="d_pad_seek_mode_title">D-Pad seek mode</string>
<string name="dpad_seek_mode_skip_time">Skip time</string>
<string name="dpad_seek_mode_trickplay">Trickplay previews</string>
<string name="italic_font">Italicize font</string>
<string name="font">Font</string>
<string name="background">Background</string>
Expand Down Expand Up @@ -850,9 +847,22 @@
<string name="confirm_enable_experimental_title">Enable experimental settings?</string>
<string name="confirm_enable_experimental_body">Experimental settings may be unstable!\n\n These may removed or changed in any release.</string>
<string name="video_tunneling">Video tunneling</string>

<string name="d_pad_seek_mode_title">D-Pad seek bar mode</string>
<string name="dpad_seek_mode_minimal">Minimal</string>
<string name="dpad_seek_mode_trickplay">Trickplay</string>
<string-array name="dpad_seek_mode_options">
<item>@string/dpad_seek_mode_skip_time</item>
<item>@string/dpad_seek_mode_minimal</item>
<item>@string/dpad_seek_mode_trickplay</item>
<item>@string/none</item>
</string-array>
<string name="dpad_seek_mode_minimal_summary">Small seek bar along the bottom of the screen (default)</string>
<string name="dpad_seek_mode_trickplay_summary">Seek bar with trickplay preview images</string>
<string name="dpad_seek_mode_none_summary">No seek bar</string>
<string-array name="dpad_seek_mode_summaries">
<item>@string/dpad_seek_mode_minimal_summary</item>
<item>@string/dpad_seek_mode_trickplay_summary</item>
<item>@string/dpad_seek_mode_none_summary</item>
</string-array>

<string name="blocklisted">Blocklisted</string>
Expand Down
Loading