From 4106d8a34543b52d2efa5d4aeaaaea58aff1b714 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 21 Oct 2024 23:29:26 -0400 Subject: [PATCH 1/4] fix(YouTube): Move `Hide album cards` patch into `Hide layout components` --- .../youtube/patches/HideAlbumCardsPatch.java | 14 -------------- .../patches/components/LayoutComponentsFilter.java | 6 ++++++ 2 files changed, 6 insertions(+), 14 deletions(-) delete mode 100644 app/src/main/java/app/revanced/integrations/youtube/patches/HideAlbumCardsPatch.java diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/HideAlbumCardsPatch.java b/app/src/main/java/app/revanced/integrations/youtube/patches/HideAlbumCardsPatch.java deleted file mode 100644 index e0d8519446..0000000000 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/HideAlbumCardsPatch.java +++ /dev/null @@ -1,14 +0,0 @@ -package app.revanced.integrations.youtube.patches; - -import android.view.View; - -import app.revanced.integrations.youtube.settings.Settings; -import app.revanced.integrations.shared.Utils; - -@SuppressWarnings("unused") -public class HideAlbumCardsPatch { - public static void hideAlbumCard(View view) { - if (!Settings.HIDE_ALBUM_CARDS.get()) return; - Utils.hideViewByLayoutParams(view); - } -} \ No newline at end of file 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 d8120660b9..93b0543a78 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 @@ -383,6 +383,12 @@ public static boolean showWatermark() { return !Settings.HIDE_VIDEO_CHANNEL_WATERMARK.get(); } + /** + * Injection point. + */ + public static void hideAlbumCard(View view) { + Utils.hideViewBy0dpUnderCondition(Settings.HIDE_ALBUM_CARDS, view); + } private static final boolean HIDE_DOODLES_ENABLED = Settings.HIDE_DOODLES.get(); From ef99ff20569bbb359d6b2c50329c3f47fce48626 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 21 Oct 2024 23:34:22 -0400 Subject: [PATCH 2/4] fix(YouTube): Merge `Hide crowdfunding box` patch into `Hide layout components` --- .../youtube/patches/HideCrowdfundingBoxPatch.java | 15 --------------- .../components/LayoutComponentsFilter.java | 7 +++++++ 2 files changed, 7 insertions(+), 15 deletions(-) delete mode 100644 app/src/main/java/app/revanced/integrations/youtube/patches/HideCrowdfundingBoxPatch.java diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/HideCrowdfundingBoxPatch.java b/app/src/main/java/app/revanced/integrations/youtube/patches/HideCrowdfundingBoxPatch.java deleted file mode 100644 index 6546da78de..0000000000 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/HideCrowdfundingBoxPatch.java +++ /dev/null @@ -1,15 +0,0 @@ -package app.revanced.integrations.youtube.patches; - -import android.view.View; - -import app.revanced.integrations.youtube.settings.Settings; -import app.revanced.integrations.shared.Utils; - -@SuppressWarnings("unused") -public class HideCrowdfundingBoxPatch { - //Used by app.revanced.patches.youtube.layout.hidecrowdfundingbox.patch.HideCrowdfundingBoxPatch - public static void hideCrowdfundingBox(View view) { - if (!Settings.HIDE_CROWDFUNDING_BOX.get()) return; - Utils.hideViewByLayoutParams(view); - } -} 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 93b0543a78..c50e2a608c 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 @@ -390,6 +390,13 @@ public static void hideAlbumCard(View view) { Utils.hideViewBy0dpUnderCondition(Settings.HIDE_ALBUM_CARDS, view); } + /** + * Injection point. + */ + public static void hideCrowdfundingBox(View view) { + Utils.hideViewBy0dpUnderCondition(Settings.HIDE_CROWDFUNDING_BOX, view); + } + private static final boolean HIDE_DOODLES_ENABLED = Settings.HIDE_DOODLES.get(); /** 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 3/4] 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(); /** From e16b8ef6fe0ba70dcdd2b0dd40ec9e3ac9c30869 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 22 Oct 2024 00:05:26 -0400 Subject: [PATCH 4/4] fix: Remove old file --- .../youtube/patches/HideFilterBarPatch.java | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 app/src/main/java/app/revanced/integrations/youtube/patches/HideFilterBarPatch.java diff --git a/app/src/main/java/app/revanced/integrations/youtube/patches/HideFilterBarPatch.java b/app/src/main/java/app/revanced/integrations/youtube/patches/HideFilterBarPatch.java deleted file mode 100644 index dd15c9528c..0000000000 --- a/app/src/main/java/app/revanced/integrations/youtube/patches/HideFilterBarPatch.java +++ /dev/null @@ -1,27 +0,0 @@ -package app.revanced.integrations.youtube.patches; - -import android.view.View; - -import app.revanced.integrations.youtube.settings.Settings; -import app.revanced.integrations.shared.Utils; - -@SuppressWarnings("unused") -public final class HideFilterBarPatch { - public static int hideInFeed(final int height) { - if (Settings.HIDE_FILTER_BAR_FEED_IN_FEED.get()) return 0; - - return height; - } - - public static void hideInRelatedVideos(final View chipView) { - if (!Settings.HIDE_FILTER_BAR_FEED_IN_RELATED_VIDEOS.get()) return; - - Utils.hideViewByLayoutParams(chipView); - } - - public static int hideInSearch(final int height) { - if (Settings.HIDE_FILTER_BAR_FEED_IN_SEARCH.get()) return 0; - - return height; - } -}