From e31fb4995b9e42672931f911c039ecb466335345 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 21 Oct 2024 23:54:08 -0400 Subject: [PATCH] fix(YouTube): Merge `Hide floating microphone` patch into `Hide layout components` --- .../HideFloatingMicrophoneButtonPatch.java | 10 ------ .../components/LayoutComponentsFilter.java | 32 +++++++++++++++++++ 2 files changed, 32 insertions(+), 10 deletions(-) delete mode 100644 app/src/main/java/app/revanced/integrations/youtube/patches/HideFloatingMicrophoneButtonPatch.java diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/HideFloatingMicrophoneButtonPatch.java b/app/src/main/java/app/revanced/integrations/youtube/patches/HideFloatingMicrophoneButtonPatch.java deleted file mode 100644 index c2074ba6a1..0000000000 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/HideFloatingMicrophoneButtonPatch.java +++ /dev/null @@ -1,10 +0,0 @@ -package app.revanced.integrations.youtube.patches; - -import app.revanced.integrations.youtube.settings.Settings; - -@SuppressWarnings("unused") -public final class HideFloatingMicrophoneButtonPatch { - public static boolean hideFloatingMicrophoneButton(final boolean original) { - return Settings.HIDE_FLOATING_MICROPHONE_BUTTON.get() || original; - } -} diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java b/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java index c50e2a608c..415b7d8c8e 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java +++ b/app/src/main/java/app/revanced/integrations/youtube/patches/components/LayoutComponentsFilter.java @@ -397,6 +397,38 @@ public static void hideCrowdfundingBox(View view) { Utils.hideViewBy0dpUnderCondition(Settings.HIDE_CROWDFUNDING_BOX, view); } + /** + * Injection point. + */ + public static boolean hideFloatingMicrophoneButton(final boolean original) { + return original || Settings.HIDE_FLOATING_MICROPHONE_BUTTON.get(); + } + + /** + * Injection point. + */ + public static int hideInFeed(final int height) { + return Settings.HIDE_FILTER_BAR_FEED_IN_FEED.get() + ? 0 + : height; + } + + /** + * Injection point. + */ + public static int hideInSearch(int height) { + return Settings.HIDE_FILTER_BAR_FEED_IN_SEARCH.get() + ? 0 + : height; + } + + /** + * Injection point. + */ + public static void hideInRelatedVideos(View chipView) { + Utils.hideViewBy0dpUnderCondition(Settings.HIDE_FILTER_BAR_FEED_IN_RELATED_VIDEOS, chipView); + } + private static final boolean HIDE_DOODLES_ENABLED = Settings.HIDE_DOODLES.get(); /**