From b728bfa3733cbb8e6ea3163c23c2ac8f3eb4868e Mon Sep 17 00:00:00 2001 From: inotia00 Date: Thu, 23 Feb 2023 00:57:00 +0900 Subject: [PATCH] add `hide-collapse-button` patch --- .../patch/HideCollapseButtonPatch.kt | 45 +++++++++++++++++++ .../youtube/settings/xml/revanced_prefs.xml | 3 ++ 2 files changed, 48 insertions(+) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/player/collapsebutton/patch/HideCollapseButtonPatch.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/player/collapsebutton/patch/HideCollapseButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/player/collapsebutton/patch/HideCollapseButtonPatch.kt new file mode 100644 index 000000000..13196c622 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/player/collapsebutton/patch/HideCollapseButtonPatch.kt @@ -0,0 +1,45 @@ +package app.revanced.patches.youtube.layout.player.collapsebutton.patch + +import app.revanced.patcher.annotation.Description +import app.revanced.patcher.annotation.Name +import app.revanced.patcher.annotation.Version +import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.patch.PatchResult +import app.revanced.patcher.patch.PatchResultSuccess +import app.revanced.patcher.patch.ResourcePatch +import app.revanced.patcher.patch.annotations.DependsOn +import app.revanced.patcher.patch.annotations.Patch +import app.revanced.patches.shared.annotation.YouTubeCompatibility +import app.revanced.patches.youtube.misc.playerbutton.patch.PlayerButtonPatch +import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch + +@Patch +@Name("hide-collapse-button") +@Description("Hides the collapse button in the video player.") +@DependsOn( + [ + PlayerButtonPatch::class, + SettingsPatch::class + ] +) +@YouTubeCompatibility +@Version("0.0.1") +class HideCollapseButtonPatch : ResourcePatch { + override fun execute(context: ResourceContext): PatchResult { + + /* + * Add settings + */ + SettingsPatch.addPreference( + arrayOf( + "PREFERENCE: OTHER_LAYOUT_SETTINGS", + "PREFERENCE_HEADER: PLAYER", + "SETTINGS: HIDE_COLLAPSE_BUTTON" + ) + ) + + SettingsPatch.updatePatchStatus("hide-live-chat-button") + + return PatchResultSuccess() + } +} diff --git a/src/main/resources/youtube/settings/xml/revanced_prefs.xml b/src/main/resources/youtube/settings/xml/revanced_prefs.xml index e673f2ecb..48e075178 100644 --- a/src/main/resources/youtube/settings/xml/revanced_prefs.xml +++ b/src/main/resources/youtube/settings/xml/revanced_prefs.xml @@ -168,6 +168,9 @@ + +