diff --git a/api/revanced-patches.api b/api/revanced-patches.api index 0a84e31702..8e2961c03e 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -1625,6 +1625,7 @@ public final class app/revanced/patches/youtube/misc/settings/SettingsPatch$Pref public final fun getMISC ()Lapp/revanced/patches/shared/misc/settings/preference/BasePreferenceScreen$Screen; public final fun getSEEKBAR ()Lapp/revanced/patches/shared/misc/settings/preference/BasePreferenceScreen$Screen; public final fun getSHORTS ()Lapp/revanced/patches/shared/misc/settings/preference/BasePreferenceScreen$Screen; + public final fun getSWIPE_CONTROLS ()Lapp/revanced/patches/shared/misc/settings/preference/BasePreferenceScreen$Screen; public final fun getVIDEO ()Lapp/revanced/patches/shared/misc/settings/preference/BasePreferenceScreen$Screen; } diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsResourcePatch.kt index 0d1ceb139c..70fe6e5052 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsResourcePatch.kt @@ -5,12 +5,9 @@ import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.all.misc.resources.AddResourcesPatch import app.revanced.patches.shared.misc.settings.preference.InputType -import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen -import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen.Sorting import app.revanced.patches.shared.misc.settings.preference.SwitchPreference import app.revanced.patches.shared.misc.settings.preference.TextPreference import app.revanced.patches.youtube.misc.settings.SettingsPatch -import app.revanced.patches.youtube.misc.settings.SettingsResourcePatch import app.revanced.util.ResourceGroup import app.revanced.util.copyResources @@ -21,22 +18,16 @@ internal object SwipeControlsResourcePatch : ResourcePatch() { override fun execute(context: ResourceContext) { AddResourcesPatch(this::class) - SettingsResourcePatch += PreferenceScreen( - key = "revanced_settings_screen_08", - titleKey = "revanced_swipe_controls_screen_title", - summaryKey = null, - sorting = Sorting.UNSORTED, - preferences = setOf( - SwitchPreference("revanced_swipe_brightness"), - SwitchPreference("revanced_swipe_volume"), - SwitchPreference("revanced_swipe_press_to_engage"), - SwitchPreference("revanced_swipe_haptic_feedback"), - SwitchPreference("revanced_swipe_save_and_restore_brightness"), - TextPreference("revanced_swipe_overlay_timeout", inputType = InputType.NUMBER), - TextPreference("revanced_swipe_text_overlay_size", inputType = InputType.NUMBER), - TextPreference("revanced_swipe_overlay_background_alpha", inputType = InputType.NUMBER), - TextPreference("revanced_swipe_threshold", inputType = InputType.NUMBER), - ), + SettingsPatch.PreferenceScreen.SWIPE_CONTROLS.addPreferences( + SwitchPreference("revanced_swipe_brightness"), + SwitchPreference("revanced_swipe_volume"), + SwitchPreference("revanced_swipe_press_to_engage"), + SwitchPreference("revanced_swipe_haptic_feedback"), + SwitchPreference("revanced_swipe_save_and_restore_brightness"), + TextPreference("revanced_swipe_overlay_timeout", inputType = InputType.NUMBER), + TextPreference("revanced_swipe_text_overlay_size", inputType = InputType.NUMBER), + TextPreference("revanced_swipe_overlay_background_alpha", inputType = InputType.NUMBER), + TextPreference("revanced_swipe_threshold", inputType = InputType.NUMBER), ) context.copyResources( diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsPatch.kt index dc086656d1..8d25bb58ac 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsPatch.kt @@ -154,7 +154,13 @@ object SettingsPatch : sorting = Sorting.UNSORTED, ) - // Swipe controls is item 8 + val SWIPE_CONTROLS = Screen( + "revanced_settings_screen_08", + "revanced_swipe_controls_screen_title", + null, + sorting = Sorting.UNSORTED, + ) + // RYD is item 9 // SB is item 10 val MISC = Screen("revanced_settings_screen_11", "revanced_misc_screen_title", null)