Skip to content

Commit

Permalink
feat(YouTube - Hide player flyout menu items): Hide stable volume (Re…
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios authored and oSumAtrIX committed Nov 6, 2024
1 parent e6ecc0f commit b91e932
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ public class PlayerFlyoutMenuItemsFilter extends Filter {
public PlayerFlyoutMenuItemsFilter() {
exception = new ByteArrayFilterGroup(
// Whitelist Quality menu item when "Hide Additional settings menu" is enabled
Settings.HIDE_ADDITIONAL_SETTINGS_MENU,
Settings.HIDE_PLAYER_FLYOUT_ADDITIONAL_SETTINGS,
"quality_sheet"
);

videoQualityMenuFooter = new StringFilterGroup(
Settings.HIDE_VIDEO_QUALITY_MENU_FOOTER,
Settings.HIDE_PLAYER_FLYOUT_VIDEO_QUALITY_FOOTER,
"quality_sheet_footer"
);

Expand All @@ -36,47 +36,51 @@ public PlayerFlyoutMenuItemsFilter() {

flyoutFilterGroupList.addAll(
new ByteArrayFilterGroup(
Settings.HIDE_CAPTIONS_MENU,
Settings.HIDE_PLAYER_FLYOUT_CAPTIONS,
"closed_caption"
),
new ByteArrayFilterGroup(
Settings.HIDE_ADDITIONAL_SETTINGS_MENU,
Settings.HIDE_PLAYER_FLYOUT_ADDITIONAL_SETTINGS,
"yt_outline_gear"
),
new ByteArrayFilterGroup(
Settings.HIDE_LOOP_VIDEO_MENU,
Settings.HIDE_PLAYER_FLYOUT_LOOP_VIDEO,
"yt_outline_arrow_repeat_1_"
),
new ByteArrayFilterGroup(
Settings.HIDE_AMBIENT_MODE_MENU,
Settings.HIDE_PLAYER_FLYOUT_AMBIENT_MODE,
"yt_outline_screen_light"
),
new ByteArrayFilterGroup(
Settings.HIDE_HELP_MENU,
Settings.HIDE_PLAYER_FLYOUT_STABLE_VOLUME,
"volume_stable"
),
new ByteArrayFilterGroup(
Settings.HIDE_PLAYER_FLYOUT_HELP,
"yt_outline_question_circle"
),
new ByteArrayFilterGroup(
Settings.HIDE_MORE_INFO_MENU,
Settings.HIDE_PLAYER_FLYOUT_MORE_INFO,
"yt_outline_info_circle"
),
new ByteArrayFilterGroup(
Settings.HIDE_LOCK_SCREEN_MENU,
Settings.HIDE_PLAYER_FLYOUT_LOCK_SCREEN,
"yt_outline_lock"
),
new ByteArrayFilterGroup(
Settings.HIDE_SPEED_MENU,
Settings.HIDE_PLAYER_FLYOUT_SPEED,
"yt_outline_play_arrow_half_circle"
),
new ByteArrayFilterGroup(
Settings.HIDE_AUDIO_TRACK_MENU,
Settings.HIDE_PLAYER_FLYOUT_AUDIO_TRACK,
"yt_outline_person_radar"
),
new ByteArrayFilterGroup(
Settings.HIDE_PLAYER_FLYOUT_MENU_SLEEP_TIMER,
Settings.HIDE_PLAYER_FLYOUT_SLEEP_TIMER,
"yt_outline_moon_z_"
),
new ByteArrayFilterGroup(
Settings.HIDE_WATCH_IN_VR_MENU,
Settings.HIDE_PLAYER_FLYOUT_WATCH_IN_VR,
"yt_outline_vr"
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,21 @@ public class Settings extends BaseSettings {
public static final BooleanSetting HIDE_PLAYLIST_BUTTON = new BooleanSetting("revanced_hide_playlist_button", FALSE);

// Player flyout menu items
public static final BooleanSetting HIDE_CAPTIONS_MENU = new BooleanSetting("revanced_hide_player_flyout_captions", FALSE);
public static final BooleanSetting HIDE_ADDITIONAL_SETTINGS_MENU = new BooleanSetting("revanced_hide_player_flyout_additional_settings", FALSE);
public static final BooleanSetting HIDE_LOOP_VIDEO_MENU = new BooleanSetting("revanced_hide_player_flyout_loop_video", FALSE);
public static final BooleanSetting HIDE_AMBIENT_MODE_MENU = new BooleanSetting("revanced_hide_player_flyout_ambient_mode", FALSE);
public static final BooleanSetting HIDE_HELP_MENU = new BooleanSetting("revanced_hide_player_flyout_help", TRUE);
public static final BooleanSetting HIDE_SPEED_MENU = new BooleanSetting("revanced_hide_player_flyout_speed", FALSE);
public static final BooleanSetting HIDE_MORE_INFO_MENU = new BooleanSetting("revanced_hide_player_flyout_more_info", TRUE);
public static final BooleanSetting HIDE_LOCK_SCREEN_MENU = new BooleanSetting("revanced_hide_player_flyout_lock_screen", FALSE);
public static final BooleanSetting HIDE_AUDIO_TRACK_MENU = new BooleanSetting("revanced_hide_player_flyout_audio_track", FALSE);
public static final BooleanSetting HIDE_PLAYER_FLYOUT_MENU_SLEEP_TIMER = new BooleanSetting("revanced_hide_player_flyout_sleep_timer", FALSE);
public static final BooleanSetting HIDE_WATCH_IN_VR_MENU = new BooleanSetting("revanced_hide_player_flyout_watch_in_vr", TRUE);
public static final BooleanSetting HIDE_VIDEO_QUALITY_MENU_FOOTER = new BooleanSetting("revanced_hide_video_quality_menu_footer", FALSE);
public static final BooleanSetting HIDE_PLAYER_FLYOUT_CAPTIONS = new BooleanSetting("revanced_hide_player_flyout_captions", FALSE);
public static final BooleanSetting HIDE_PLAYER_FLYOUT_ADDITIONAL_SETTINGS = new BooleanSetting("revanced_hide_player_flyout_additional_settings", FALSE);
public static final BooleanSetting HIDE_PLAYER_FLYOUT_LOOP_VIDEO = new BooleanSetting("revanced_hide_player_flyout_loop_video", FALSE);
public static final BooleanSetting HIDE_PLAYER_FLYOUT_AMBIENT_MODE = new BooleanSetting("revanced_hide_player_flyout_ambient_mode", FALSE);
public static final BooleanSetting HIDE_PLAYER_FLYOUT_HELP = new BooleanSetting("revanced_hide_player_flyout_help", TRUE);
public static final BooleanSetting HIDE_PLAYER_FLYOUT_SPEED = new BooleanSetting("revanced_hide_player_flyout_speed", FALSE);
public static final BooleanSetting HIDE_PLAYER_FLYOUT_MORE_INFO = new BooleanSetting("revanced_hide_player_flyout_more_info", TRUE);
public static final BooleanSetting HIDE_PLAYER_FLYOUT_LOCK_SCREEN = new BooleanSetting("revanced_hide_player_flyout_lock_screen", FALSE);
public static final BooleanSetting HIDE_PLAYER_FLYOUT_AUDIO_TRACK = new BooleanSetting("revanced_hide_player_flyout_audio_track", FALSE);
public static final BooleanSetting HIDE_PLAYER_FLYOUT_SLEEP_TIMER = new BooleanSetting("revanced_hide_player_flyout_sleep_timer", FALSE);
public static final BooleanSetting HIDE_PLAYER_FLYOUT_STABLE_VOLUME = new BooleanSetting("revanced_hide_player_flyout_stable_volume", FALSE);
public static final BooleanSetting HIDE_PLAYER_FLYOUT_WATCH_IN_VR = new BooleanSetting("revanced_hide_player_flyout_watch_in_vr", TRUE);
@Deprecated
private static final BooleanSetting DEPRECATED_HIDE_PLAYER_FLYOUT_VIDEO_QUALITY_FOOTER = new BooleanSetting("revanced_hide_video_quality_menu_footer", FALSE);
public static final BooleanSetting HIDE_PLAYER_FLYOUT_VIDEO_QUALITY_FOOTER = new BooleanSetting("revanced_hide_player_flyout_video_quality_footer", FALSE);

// General layout
public static final EnumSetting<StartPage> CHANGE_START_PAGE = new EnumSetting<>("revanced_change_start_page", StartPage.ORIGINAL, true);
Expand Down Expand Up @@ -379,6 +382,8 @@ public class Settings extends BaseSettings {

migrateOldSettingToNew(HIDE_PLAYER_BUTTONS, HIDE_PLAYER_PREVIOUS_NEXT_BUTTONS);

migrateOldSettingToNew(DEPRECATED_HIDE_PLAYER_FLYOUT_VIDEO_QUALITY_FOOTER, HIDE_PLAYER_FLYOUT_VIDEO_QUALITY_FOOTER);

// endregion
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ val hidePlayerFlyoutMenuPatch = bytecodePatch(
SwitchPreference("revanced_hide_player_flyout_additional_settings"),
SwitchPreference("revanced_hide_player_flyout_loop_video"),
SwitchPreference("revanced_hide_player_flyout_ambient_mode"),
SwitchPreference("revanced_hide_player_flyout_stable_volume"),
SwitchPreference("revanced_hide_player_flyout_help"),
SwitchPreference("revanced_hide_player_flyout_speed"),
SwitchPreference("revanced_hide_player_flyout_lock_screen"),
SwitchPreference("revanced_hide_player_flyout_more_info"),
SwitchPreference("revanced_hide_player_flyout_audio_track"),
SwitchPreference("revanced_hide_player_flyout_watch_in_vr"),
SwitchPreference("revanced_hide_player_flyout_sleep_timer"),
SwitchPreference("revanced_hide_video_quality_menu_footer"),
SwitchPreference("revanced_hide_player_flyout_video_quality_footer"),
),
),
)
Expand Down
9 changes: 6 additions & 3 deletions patches/src/main/resources/addresources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,9 @@ This is because Crowdin requires temporarily flattening this file and removing t
<string name="revanced_hide_player_flyout_ambient_mode_title">Hide Ambient mode</string>
<string name="revanced_hide_player_flyout_ambient_mode_summary_on">Ambient mode menu is hidden</string>
<string name="revanced_hide_player_flyout_ambient_mode_summary_off">Ambient mode menu is shown</string>
<string name="revanced_hide_player_flyout_stable_volume_title">Hide Stable volume</string>
<string name="revanced_hide_player_flyout_stable_volume_summary_off">Stable volume menu is shown</string>
<string name="revanced_hide_player_flyout_stable_volume_summary_on">Stable volume menu is hidden</string>
<!-- 'Help & feedback' should be translated using the same localized wording YouTube displays for the menu item. -->
<string name="revanced_hide_player_flyout_help_title">Hide Help &amp; feedback</string>
<string name="revanced_hide_player_flyout_help_summary_on">Help &amp; feedback menu is hidden</string>
Expand All @@ -552,9 +555,9 @@ This is because Crowdin requires temporarily flattening this file and removing t
<string name="revanced_hide_player_flyout_watch_in_vr_title">Hide Watch in VR</string>
<string name="revanced_hide_player_flyout_watch_in_vr_summary_on">Watch in VR menu is hidden</string>
<string name="revanced_hide_player_flyout_watch_in_vr_summary_off">Watch in VR menu is shown</string>
<string name="revanced_hide_video_quality_menu_footer_title">Hide video quality menu footer</string>
<string name="revanced_hide_video_quality_menu_footer_summary_on">Video quality menu footer is hidden</string>
<string name="revanced_hide_video_quality_menu_footer_summary_off">Video quality menu footer is shown</string>
<string name="revanced_hide_player_flyout_video_quality_footer_title">Hide video quality menu footer</string>
<string name="revanced_hide_player_flyout_video_quality_footer_summary_on">Video quality menu footer is hidden</string>
<string name="revanced_hide_player_flyout_video_quality_footer_summary_off">Video quality menu footer is shown</string>
</patch>
<patch id="layout.buttons.overlay.hidePlayerOverlayButtonsPatch">
<string name="revanced_hide_player_previous_next_buttons_title">Hide previous &amp; next video buttons</string>
Expand Down

0 comments on commit b91e932

Please sign in to comment.