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/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/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; - } -} 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 d8120660b9..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 @@ -383,6 +383,51 @@ 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); + } + + /** + * Injection point. + */ + 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();