Skip to content

Commit 274dcc6

Browse files
feat(YouTube - Hide video action buttons): Add Hide Stop ads (#5245)
1 parent 446de1c commit 274dcc6

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/ButtonsFilter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public ButtonsFilter() {
4646
"|download_button.eml"
4747
),
4848
new StringFilterGroup(
49-
Settings.HIDE_PLAYLIST_BUTTON,
49+
Settings.HIDE_SAVE_BUTTON,
5050
"|save_to_playlist_button"
5151
),
5252
new StringFilterGroup(
@@ -76,6 +76,10 @@ public ButtonsFilter() {
7676
Settings.HIDE_ASK_BUTTON,
7777
"yt_fill_spark"
7878
),
79+
new ByteArrayFilterGroup(
80+
Settings.HIDE_STOP_ADS_BUTTON,
81+
"yt_outline_slash_circle_left"
82+
),
7983
// Check for clip button both here and using a path filter,
8084
// as there's a chance the path is a generic action button and won't contain 'clip_button'
8185
new ByteArrayFilterGroup(

extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/Settings.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,16 @@ public class Settings extends BaseSettings {
200200
public static final BooleanSetting HIDE_TRANSCRIPT_SECTION = new BooleanSetting("revanced_hide_transcript_section", TRUE);
201201
// Action buttons
202202
public static final BooleanSetting DISABLE_LIKE_SUBSCRIBE_GLOW = new BooleanSetting("revanced_disable_like_subscribe_glow", FALSE);
203+
public static final BooleanSetting HIDE_ASK_BUTTON = new BooleanSetting("revanced_hide_ask_button", FALSE);
203204
public static final BooleanSetting HIDE_CLIP_BUTTON = new BooleanSetting("revanced_hide_clip_button", TRUE);
204205
public static final BooleanSetting HIDE_DOWNLOAD_BUTTON = new BooleanSetting("revanced_hide_download_button", FALSE);
205206
public static final BooleanSetting HIDE_LIKE_DISLIKE_BUTTON = new BooleanSetting("revanced_hide_like_dislike_button", FALSE);
206-
public static final BooleanSetting HIDE_PLAYLIST_BUTTON = new BooleanSetting("revanced_hide_playlist_button", FALSE);
207207
public static final BooleanSetting HIDE_REMIX_BUTTON = new BooleanSetting("revanced_hide_remix_button", TRUE);
208208
public static final BooleanSetting HIDE_REPORT_BUTTON = new BooleanSetting("revanced_hide_report_button", FALSE);
209+
public static final BooleanSetting HIDE_SAVE_BUTTON = new BooleanSetting("revanced_hide_save_button", FALSE);
209210
public static final BooleanSetting HIDE_SHARE_BUTTON = new BooleanSetting("revanced_hide_share_button", FALSE);
211+
public static final BooleanSetting HIDE_STOP_ADS_BUTTON = new BooleanSetting("revanced_hide_stop_ads_button", TRUE);
210212
public static final BooleanSetting HIDE_THANKS_BUTTON = new BooleanSetting("revanced_hide_thanks_button", TRUE);
211-
public static final BooleanSetting HIDE_ASK_BUTTON = new BooleanSetting("revanced_hide_ask_button", FALSE);
212213
// Player flyout menu items
213214
public static final BooleanSetting HIDE_PLAYER_FLYOUT_ADDITIONAL_SETTINGS = new BooleanSetting("revanced_hide_player_flyout_additional_settings", FALSE);
214215
public static final BooleanSetting HIDE_PLAYER_FLYOUT_AMBIENT_MODE = new BooleanSetting("revanced_hide_player_flyout_ambient_mode", FALSE);

patches/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,16 @@ val hideButtonsPatch = resourcePatch(
3838
"revanced_hide_buttons_screen",
3939
preferences = setOf(
4040
SwitchPreference("revanced_disable_like_subscribe_glow"),
41+
SwitchPreference("revanced_hide_ask_button"),
42+
SwitchPreference("revanced_hide_clip_button"),
43+
SwitchPreference("revanced_hide_download_button"),
4144
SwitchPreference("revanced_hide_like_dislike_button"),
42-
SwitchPreference("revanced_hide_share_button"),
43-
SwitchPreference("revanced_hide_report_button"),
4445
SwitchPreference("revanced_hide_remix_button"),
45-
SwitchPreference("revanced_hide_download_button"),
46+
SwitchPreference("revanced_hide_report_button"),
47+
SwitchPreference("revanced_hide_save_button"),
48+
SwitchPreference("revanced_hide_share_button"),
49+
SwitchPreference("revanced_hide_stop_ads_button"),
4650
SwitchPreference("revanced_hide_thanks_button"),
47-
SwitchPreference("revanced_hide_ask_button"),
48-
SwitchPreference("revanced_hide_clip_button"),
49-
SwitchPreference("revanced_hide_playlist_button"),
5051
)
5152
)
5253
)

patches/src/main/resources/addresources/values/strings.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,10 @@ Adjust volume by swiping vertically on the right side of the screen"</string>
595595
<string name="revanced_hide_share_button_title">Hide Share</string>
596596
<string name="revanced_hide_share_button_summary_on">Share button is hidden</string>
597597
<string name="revanced_hide_share_button_summary_off">Share button is shown</string>
598+
<!-- 'Stop ads' should be translated with the same localized wording that YouTube displays. -->
599+
<string name="revanced_hide_stop_ads_button_title">Hide Stop ads</string>
600+
<string name="revanced_hide_stop_ads_button_summary_on">Stop ads button is hidden</string>
601+
<string name="revanced_hide_stop_ads_button_summary_off">Stop ads button is shown</string>
598602
<!-- 'Report' should be translated with the same localized wording that YouTube displays.
599603
This button usually appears only on live streams. -->
600604
<string name="revanced_hide_report_button_title">Hide Report</string>
@@ -622,9 +626,9 @@ Adjust volume by swiping vertically on the right side of the screen"</string>
622626
<string name="revanced_hide_clip_button_summary_on">Clip button is hidden</string>
623627
<string name="revanced_hide_clip_button_summary_off">Clip button is shown</string>
624628
<!-- 'Save' should be translated with the same localized wording that YouTube displays. -->
625-
<string name="revanced_hide_playlist_button_title">Hide Save to playlist</string>
626-
<string name="revanced_hide_playlist_button_summary_on">Save to playlist button is hidden</string>
627-
<string name="revanced_hide_playlist_button_summary_off">Save to playlist button is shown</string>
629+
<string name="revanced_hide_save_button_title">Hide Save</string>
630+
<string name="revanced_hide_save_button_summary_on">Save button is hidden</string>
631+
<string name="revanced_hide_save_button_summary_off">Save button is shown</string>
628632
</patch>
629633
<patch id="layout.buttons.navigation.navigationButtonsPatch">
630634
<string name="revanced_navigation_buttons_screen_title">Navigation buttons</string>

0 commit comments

Comments
 (0)