From 9146dc224503d3297d1ce93dcfd9984546d46224 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 27 May 2023 11:47:58 +0400 Subject: [PATCH] feat(youtube/hide-shorts-components): hide shorts info panel (#415) --- .../integrations/patches/components/ShortsFilter.java | 8 ++++++++ .../app/revanced/integrations/settings/SettingsEnum.java | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/integrations/java/app/revanced/integrations/patches/components/ShortsFilter.java b/integrations/java/app/revanced/integrations/patches/components/ShortsFilter.java index 43ab563f9..4fbd97d3d 100644 --- a/integrations/java/app/revanced/integrations/patches/components/ShortsFilter.java +++ b/integrations/java/app/revanced/integrations/patches/components/ShortsFilter.java @@ -20,6 +20,11 @@ public final class ShortsFilter extends Filter { "reel_channel_bar" ); + private final StringFilterGroup infoPanel = new StringFilterGroup( + SettingsEnum.HIDE_SHORTS_INFO_PANEL, + "shorts_info_panel_overview" + ); + public ShortsFilter() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) return; @@ -55,6 +60,9 @@ public final class ShortsFilter extends Filter { if (reelChannelBar.check(path).isFiltered()) if (this.pathFilterGroups.contains(path)) return true; + // Shorts info panel path appears outside of reelChannelBar path. + if (infoPanel.isEnabled() && infoPanel.check(path).isFiltered()) return true; + return this.identifierFilterGroups.contains(identifier); } diff --git a/integrations/java/app/revanced/integrations/settings/SettingsEnum.java b/integrations/java/app/revanced/integrations/settings/SettingsEnum.java index bd59d9f2d..b65e5aeaf 100644 --- a/integrations/java/app/revanced/integrations/settings/SettingsEnum.java +++ b/integrations/java/app/revanced/integrations/settings/SettingsEnum.java @@ -132,12 +132,13 @@ public enum SettingsEnum { HIDE_FILTER_BAR_FEED_IN_FEED("revanced_hide_filter_bar_feed_in_feed", BOOLEAN, FALSE, true), HIDE_FILTER_BAR_FEED_IN_SEARCH("revanced_hide_filter_bar_feed_in_search", BOOLEAN, FALSE, true), HIDE_FILTER_BAR_FEED_IN_RELATED_VIDEOS("revanced_hide_filter_bar_feed_in_related_videos", BOOLEAN, FALSE, true), - HIDE_SHORTS_JOIN_BUTTON("revanced_hide_shorts_join_button", BOOLEAN, FALSE), + HIDE_SHORTS_JOIN_BUTTON("revanced_hide_shorts_join_button", BOOLEAN, TRUE), HIDE_SHORTS_SUBSCRIBE_BUTTON("revanced_hide_shorts_subscribe_button", BOOLEAN, FALSE), - HIDE_SHORTS_THANKS_BUTTON("revanced_hide_shorts_thanks_button", BOOLEAN, FALSE), + HIDE_SHORTS_THANKS_BUTTON("revanced_hide_shorts_thanks_button", BOOLEAN, TRUE), HIDE_SHORTS_COMMENTS_BUTTON("revanced_hide_shorts_comments_button", BOOLEAN, FALSE), - HIDE_SHORTS_REMIX_BUTTON("revanced_hide_shorts_remix_button", BOOLEAN, FALSE), + HIDE_SHORTS_REMIX_BUTTON("revanced_hide_shorts_remix_button", BOOLEAN, TRUE), HIDE_SHORTS_SHARE_BUTTON("revanced_hide_shorts_share_button", BOOLEAN, FALSE), + HIDE_SHORTS_INFO_PANEL("revanced_hide_shorts_info_panel", BOOLEAN, TRUE), HIDE_SHORTS_NAVIGATION_BAR("revanced_hide_shorts_navigation_bar", BOOLEAN, TRUE, true), HIDE_SHORTS("revanced_hide_shorts", BOOLEAN, FALSE, true),