From 6bd5aae9772e80809dbee9f8fffc1247364a9a13 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Wed, 25 Oct 2023 01:47:03 +0200 Subject: [PATCH] feat(YouTube): Add `Disable suggested video end screen` patch --- .../DisableSuggestedVideoEndScreenPatch.java | 13 +++++++++++++ .../integrations/settings/SettingsEnum.java | 1 + 2 files changed, 14 insertions(+) create mode 100644 app/src/main/java/app/revanced/integrations/patches/DisableSuggestedVideoEndScreenPatch.java diff --git a/app/src/main/java/app/revanced/integrations/patches/DisableSuggestedVideoEndScreenPatch.java b/app/src/main/java/app/revanced/integrations/patches/DisableSuggestedVideoEndScreenPatch.java new file mode 100644 index 00000000..9f435818 --- /dev/null +++ b/app/src/main/java/app/revanced/integrations/patches/DisableSuggestedVideoEndScreenPatch.java @@ -0,0 +1,13 @@ +package app.revanced.integrations.patches; + +import android.widget.ImageView; +import app.revanced.integrations.settings.SettingsEnum; + +/** @noinspection unused*/ +public final class DisableSuggestedVideoEndScreenPatch { + public static void closeEndScreen(ImageView imageView) { + if (!SettingsEnum.DISABLE_SUGGESTED_VIDEO_END_SCREEN.getBoolean()) return; + + imageView.performClick(); + } +} 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 2d1c21ac..873d1490 100644 --- a/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java +++ b/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java @@ -147,6 +147,7 @@ public enum SettingsEnum { HIDE_SHORTS_CHANNEL_BAR("revanced_hide_shorts_channel_bar", BOOLEAN, FALSE), HIDE_SHORTS_NAVIGATION_BAR("revanced_hide_shorts_navigation_bar", BOOLEAN, TRUE, true), HIDE_SHORTS("revanced_hide_shorts", BOOLEAN, FALSE, true), + DISABLE_SUGGESTED_VIDEO_END_SCREEN("revanced_disable_suggested_video_end_screen", BOOLEAN, TRUE), DISABLE_FULLSCREEN_AMBIENT_MODE("revanced_disable_fullscreen_ambient_mode", BOOLEAN, TRUE, true), ALT_THUMBNAIL("revanced_alt_thumbnail", BOOLEAN, FALSE), ALT_THUMBNAIL_TYPE("revanced_alt_thumbnail_type", INTEGER, 2, parents(ALT_THUMBNAIL)),