From 4b5f3deef9c3a8c700e23a0f4d9ce999013ec9d4 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 5 Oct 2024 20:08:54 -0400 Subject: [PATCH] feat(YouTube - Hide layout components): Add option to hide Yoodles (YouTube Doodles) (#712) --- .../components/LayoutComponentsFilter.java | 16 ++++++++++++++++ .../integrations/youtube/settings/Settings.java | 1 + 2 files changed, 17 insertions(+) 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 073505c8..c2e7b740 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 @@ -2,6 +2,7 @@ package app.revanced.integrations.youtube.patches.components; import static app.revanced.integrations.youtube.shared.NavigationBar.NavigationButton; +import android.graphics.drawable.Drawable; import android.os.Build; import android.view.View; @@ -380,6 +381,21 @@ public final class LayoutComponentsFilter extends Filter { return !Settings.HIDE_VIDEO_CHANNEL_WATERMARK.get(); } + + private static final boolean HIDE_YOODLES_ENABLED = Settings.HIDE_YOODLES.get(); + + /** + * Injection point. + */ + @Nullable + public static Drawable hideYoodles(Drawable animatedYoodle) { + if (HIDE_YOODLES_ENABLED) { + return null; + } + + return animatedYoodle; + } + private static final boolean HIDE_SHOW_MORE_BUTTON_ENABLED = Settings.HIDE_SHOW_MORE_BUTTON.get(); /** diff --git a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java index 3826d68a..77c84368 100644 --- a/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java +++ b/app/src/main/java/app/revanced/integrations/youtube/settings/Settings.java @@ -57,6 +57,7 @@ public class Settings extends BaseSettings { public static final BooleanSetting HIDE_ALBUM_CARDS = new BooleanSetting("revanced_hide_album_cards", FALSE, true); public static final BooleanSetting HIDE_ARTIST_CARDS = new BooleanSetting("revanced_hide_artist_cards", FALSE); public static final BooleanSetting HIDE_EXPANDABLE_CHIP = new BooleanSetting("revanced_hide_expandable_chip", TRUE); + public static final BooleanSetting HIDE_YOODLES = new BooleanSetting("revanced_hide_yoodles", FALSE, true, "revanced_hide_yoodles_user_dialog_message"); // Alternative thumbnails public static final EnumSetting ALT_THUMBNAIL_HOME = new EnumSetting<>("revanced_alt_thumbnail_home", ThumbnailOption.ORIGINAL);