From b5e81d0eaff3ab67a59ccd45eac6bf9414ed1380 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sat, 19 Nov 2022 23:21:57 +0100 Subject: [PATCH] feat(youtube/general-ads): custom component filter --- .../ad/general/patch/GeneralAdsPatch.kt | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/patch/GeneralAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/patch/GeneralAdsPatch.kt index d55ca17b3e..5f4ba8c371 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/patch/GeneralAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/patch/GeneralAdsPatch.kt @@ -185,6 +185,39 @@ class GeneralAdsPatch : ResourcePatch { "revanced_adremover_chapter_teaser_enabled_summary_off", "Chapter teasers are shown" ) + ), + PreferenceScreen( + "revanced_adremover_custom", + StringResource("revanced_adremover_custom_title", "Custom filter"), + listOf( + SwitchPreference( + "revanced_adremover_custom_enabled", + StringResource( + "revanced_adremover_custom_enabled_title", + "Enable custom filter" + ), + false, + StringResource( + "revanced_adremover_custom_enabled_summary_on", + "Custom filter is enabled" + ), + StringResource( + "revanced_adremover_custom_enabled_summary_off", + "Custom filter is disabled" + ) + ), + // TODO: This should be a ListPreference, which does not exist yet + TextPreference( + "revanced_adremover_custom_strings", + StringResource("revanced_adremover_custom_strings_title", "Custom filter"), + InputType.STRING, + "", + StringResource( + "revanced_adremover_custom_strings_summary", + "Filter components by their name separated by a comma" + ) + ) + ) ) )