From 85971bcd5e25e05d565e7d18d97b672363113ded Mon Sep 17 00:00:00 2001 From: OxrxL <108184954+OxrxL@users.noreply.github.com> Date: Tue, 8 Nov 2022 00:11:49 +0100 Subject: [PATCH] fix(youtube/hide-info-cards): remove initial popup of info-cards (#199) Co-authored-by: oSumAtrIX --- .../patches/HideInfoCardSuggestionsPatch.java | 14 -------------- .../integrations/patches/HideInfocardsPatch.java | 16 ++++++++++++++++ .../integrations/settings/SettingsEnum.java | 2 +- 3 files changed, 17 insertions(+), 15 deletions(-) delete mode 100644 app/src/main/java/app/revanced/integrations/patches/HideInfoCardSuggestionsPatch.java create mode 100644 app/src/main/java/app/revanced/integrations/patches/HideInfocardsPatch.java diff --git a/app/src/main/java/app/revanced/integrations/patches/HideInfoCardSuggestionsPatch.java b/app/src/main/java/app/revanced/integrations/patches/HideInfoCardSuggestionsPatch.java deleted file mode 100644 index 0d5301de..00000000 --- a/app/src/main/java/app/revanced/integrations/patches/HideInfoCardSuggestionsPatch.java +++ /dev/null @@ -1,14 +0,0 @@ -package app.revanced.integrations.patches; - -import android.view.View; - -import app.revanced.integrations.settings.SettingsEnum; - -public class HideInfoCardSuggestionsPatch { - - public static void hideInfoCardSuggestions(View view) { - if (!SettingsEnum.INFO_CARDS_SHOWN.getBoolean()) { - view.setVisibility(View.GONE); - } - } -} diff --git a/app/src/main/java/app/revanced/integrations/patches/HideInfocardsPatch.java b/app/src/main/java/app/revanced/integrations/patches/HideInfocardsPatch.java new file mode 100644 index 00000000..a42792a2 --- /dev/null +++ b/app/src/main/java/app/revanced/integrations/patches/HideInfocardsPatch.java @@ -0,0 +1,16 @@ +package app.revanced.integrations.patches; + +import android.view.View; + +import app.revanced.integrations.settings.SettingsEnum; + +public class HideInfocardsPatch { + public static void hideInfocardsIncognito(View view) { + if (!SettingsEnum.HIDE_INFO_CARDS.getBoolean()) return; + view.setVisibility(View.GONE); + } + + public static boolean hideInfocardsMethodCall() { + return SettingsEnum.HIDE_INFO_CARDS.getBoolean(); + } +} diff --git a/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java b/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java index 0c30ffed..b1423f84 100644 --- a/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java +++ b/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java @@ -56,7 +56,7 @@ public enum SettingsEnum { // Layout settings REEL_BUTTON_SHOWN("revanced_reel_button_enabled", false, ReturnType.BOOLEAN, true), - INFO_CARDS_SHOWN("revanced_info_cards_enabled", false, ReturnType.BOOLEAN), + HIDE_INFO_CARDS("revanced_hide_infocards", true, ReturnType.BOOLEAN), BRANDING_SHOWN("revanced_branding_watermark_enabled", false, ReturnType.BOOLEAN), CAST_BUTTON_SHOWN("revanced_cast_button_enabled", false, ReturnType.BOOLEAN, true), AUTOPLAY_BUTTON_SHOWN("revanced_autoplay_button_enabled", false, ReturnType.BOOLEAN, true),