From 8dd396b777118f19b2a1328529c17cf8fa948cd3 Mon Sep 17 00:00:00 2001
From: Damontecres <154766448+damontecres@users.noreply.github.com>
Date: Fri, 24 Apr 2026 14:50:23 -0400
Subject: [PATCH] Move skip segments settings to their own page (#1306)
## Description
Moves the five skip segment settings to their own page. So there's now a
single "Skip behavior" that you click to bring up the settings for the
five. I doubt many people change these frequently, so moving them to a
new page de-clutters the settings page.
### Related issues
N/A
### Testing
Emulator
## Screenshots
### Advanced settings
### Skip segment specific settings
## AI or LLM usage
None
---
.../wholphin/preferences/AppPreference.kt | 60 +++++++------------
.../ui/preferences/PreferenceUtils.kt | 1 +
.../ui/preferences/PreferencesContent.kt | 4 ++
app/src/main/res/values/strings.xml | 2 +
4 files changed, 30 insertions(+), 37 deletions(-)
diff --git a/app/src/main/java/com/github/damontecres/wholphin/preferences/AppPreference.kt b/app/src/main/java/com/github/damontecres/wholphin/preferences/AppPreference.kt
index 9ca6df06..3cac262a 100644
--- a/app/src/main/java/com/github/damontecres/wholphin/preferences/AppPreference.kt
+++ b/app/src/main/java/com/github/damontecres/wholphin/preferences/AppPreference.kt
@@ -114,30 +114,6 @@ sealed interface AppPreference {
},
)
-// val GridJumpButtons =
-// AppSwitchPreference(
-// title = R.string.show_grid_jump_buttons,
-// defaultValue = true,
-// getter = { it.interfacePreferences.showGridJumpButtons },
-// setter = { prefs, value ->
-// prefs.updateInterfacePreferences { showGridJumpButtons = value }
-// },
-// summaryOn = R.string.enabled,
-// summaryOff = R.string.disabled,
-// )
-
-// val ShowGridFooter =
-// AppSwitchPreference(
-// title = R.string.grid_position_footer,
-// defaultValue = true,
-// getter = { it.interfacePreferences.showPositionFooter },
-// setter = { prefs, value ->
-// prefs.updateInterfacePreferences { showPositionFooter = value }
-// },
-// summaryOn = R.string.show,
-// summaryOff = R.string.hide,
-// )
-
val ControllerTimeout =
AppSliderPreference(
title = R.string.hide_controller_timeout,
@@ -630,6 +606,13 @@ sealed interface AppPreference {
valueToIndex = { if (it != SkipSegmentBehavior.UNRECOGNIZED) it.number else 0 },
)
+ val SkipSegments =
+ AppDestinationPreference(
+ title = R.string.skip_behavior,
+ summary = R.string.skip_behavior_summary,
+ destination = Destination.Settings(PreferenceScreenOption.SKIP_SEGMENTS),
+ )
+
val GlobalContentScale =
AppChoicePreference(
title = R.string.global_content_scale,
@@ -1142,6 +1125,21 @@ val MpvPreferences =
),
)
+val SkipSegmentPreferences =
+ listOf(
+ PreferenceGroup(
+ title = R.string.skip,
+ preferences =
+ listOf(
+ AppPreference.SkipIntros,
+ AppPreference.SkipOutros,
+ AppPreference.SkipCommercials,
+ AppPreference.SkipPreviews,
+ AppPreference.SkipRecaps,
+ ),
+ ),
+ )
+
val advancedPreferences =
buildList {
add(
@@ -1169,6 +1167,7 @@ val advancedPreferences =
listOf(
AppPreference.OneClickPause,
AppPreference.GlobalContentScale,
+ AppPreference.SkipSegments,
AppPreference.MaxBitrate,
AppPreference.RefreshRateSwitching,
AppPreference.ResolutionSwitching,
@@ -1176,19 +1175,6 @@ val advancedPreferences =
),
),
)
- add(
- PreferenceGroup(
- title = R.string.skip,
- preferences =
- listOf(
- AppPreference.SkipIntros,
- AppPreference.SkipOutros,
- AppPreference.SkipCommercials,
- AppPreference.SkipPreviews,
- AppPreference.SkipRecaps,
- ),
- ),
- )
add(
PreferenceGroup(
title = R.string.player_backend,
diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/preferences/PreferenceUtils.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/preferences/PreferenceUtils.kt
index 454a0266..06399fe9 100644
--- a/app/src/main/java/com/github/damontecres/wholphin/ui/preferences/PreferenceUtils.kt
+++ b/app/src/main/java/com/github/damontecres/wholphin/ui/preferences/PreferenceUtils.kt
@@ -36,6 +36,7 @@ enum class PreferenceScreenOption {
EXO_PLAYER,
MPV,
SCREENSAVER,
+ SKIP_SEGMENTS,
;
companion object {
diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/preferences/PreferencesContent.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/preferences/PreferencesContent.kt
index a4234f17..52d182e1 100644
--- a/app/src/main/java/com/github/damontecres/wholphin/ui/preferences/PreferencesContent.kt
+++ b/app/src/main/java/com/github/damontecres/wholphin/ui/preferences/PreferencesContent.kt
@@ -53,6 +53,7 @@ import com.github.damontecres.wholphin.preferences.ExoPlayerPreferences
import com.github.damontecres.wholphin.preferences.MpvPreferences
import com.github.damontecres.wholphin.preferences.PlayerBackend
import com.github.damontecres.wholphin.preferences.ScreensaverPreference
+import com.github.damontecres.wholphin.preferences.SkipSegmentPreferences
import com.github.damontecres.wholphin.preferences.advancedPreferences
import com.github.damontecres.wholphin.preferences.basicPreferences
import com.github.damontecres.wholphin.preferences.screensaverPreferences
@@ -142,6 +143,7 @@ fun PreferencesContent(
PreferenceScreenOption.EXO_PLAYER -> ExoPlayerPreferences
PreferenceScreenOption.MPV -> MpvPreferences
PreferenceScreenOption.SCREENSAVER -> screensaverPreferences
+ PreferenceScreenOption.SKIP_SEGMENTS -> SkipSegmentPreferences
}
val screenTitle =
when (preferenceScreenOption) {
@@ -150,6 +152,7 @@ fun PreferencesContent(
PreferenceScreenOption.EXO_PLAYER -> R.string.exoplayer_options
PreferenceScreenOption.MPV -> R.string.mpv_options
PreferenceScreenOption.SCREENSAVER -> R.string.screensaver_settings
+ PreferenceScreenOption.SKIP_SEGMENTS -> R.string.skip_behavior
}
var visible by remember { mutableStateOf(false) }
@@ -707,6 +710,7 @@ fun PreferencesPage(
PreferenceScreenOption.EXO_PLAYER,
PreferenceScreenOption.MPV,
PreferenceScreenOption.SCREENSAVER,
+ PreferenceScreenOption.SKIP_SEGMENTS,
-> {
PreferencesContent(
initialPreferences,
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 8857efff..92d82972 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -767,6 +767,8 @@
Direct play with ExoPlayer built-in
Burn in/transcode on server
SSA/ASS subtitle playback
+ Skip behavior
+ For intros, credits, etc
- @string/ass_subtitle_mode_libass
- @string/ass_subtitle_mode_exoplayer