2023-09-20 05:33:02 +02:00
|
|
|
package app.revanced.patches.youtube.layout.hide.comments
|
2022-10-25 23:33:49 +02:00
|
|
|
|
|
|
|
import app.revanced.patcher.data.ResourceContext
|
|
|
|
import app.revanced.patcher.patch.ResourcePatch
|
2023-09-20 05:33:02 +02:00
|
|
|
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
|
|
|
import app.revanced.patcher.patch.annotation.Patch
|
2022-11-28 20:13:34 +01:00
|
|
|
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
|
|
|
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
|
|
|
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
2023-09-20 05:33:02 +02:00
|
|
|
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
|
|
|
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
|
|
|
|
|
|
|
@Patch(
|
|
|
|
name = "Comments",
|
|
|
|
description = "Hides components related to comments.",
|
|
|
|
dependencies = [
|
|
|
|
SettingsPatch::class,
|
|
|
|
LithoFilterPatch::class
|
|
|
|
],
|
|
|
|
compatiblePackages = [
|
|
|
|
CompatiblePackage(
|
|
|
|
"com.google.android.youtube",
|
|
|
|
[
|
|
|
|
"18.16.37",
|
|
|
|
"18.19.35",
|
|
|
|
"18.20.39",
|
|
|
|
"18.23.35",
|
|
|
|
"18.29.38",
|
2023-09-28 01:28:25 +02:00
|
|
|
"18.32.39",
|
2023-10-08 03:37:42 +02:00
|
|
|
"18.37.36",
|
|
|
|
"18.38.44"
|
2023-09-20 05:33:02 +02:00
|
|
|
]
|
|
|
|
)
|
|
|
|
]
|
|
|
|
)
|
|
|
|
@Suppress("unused")
|
|
|
|
object CommentsPatch : ResourcePatch() {
|
|
|
|
private const val FILTER_CLASS_DESCRIPTOR =
|
|
|
|
"Lapp/revanced/integrations/patches/components/CommentsFilter;"
|
2022-10-25 23:33:49 +02:00
|
|
|
|
2023-08-27 21:40:49 +02:00
|
|
|
override fun execute(context: ResourceContext) {
|
2023-06-18 01:47:31 +02:00
|
|
|
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
|
|
|
|
2022-10-25 23:33:49 +02:00
|
|
|
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
|
|
|
PreferenceScreen(
|
2023-05-15 09:51:43 +02:00
|
|
|
"revanced_comments_preference_screen",
|
|
|
|
StringResource("revanced_comments_preference_screen_title", "Comments"),
|
2022-10-25 23:33:49 +02:00
|
|
|
listOf(
|
|
|
|
SwitchPreference(
|
|
|
|
"revanced_hide_comments_section",
|
2022-12-06 23:47:25 +01:00
|
|
|
StringResource("revanced_hide_comments_section_title", "Hide comments section"),
|
2022-10-25 23:33:49 +02:00
|
|
|
StringResource("revanced_hide_comments_section_summary_on", "Comment section is hidden"),
|
|
|
|
StringResource("revanced_hide_comments_section_summary_off", "Comment section is shown")
|
|
|
|
),
|
|
|
|
SwitchPreference(
|
|
|
|
"revanced_hide_preview_comment",
|
|
|
|
StringResource("revanced_hide_preview_comment_title", "Hide preview comment"),
|
|
|
|
StringResource("revanced_hide_preview_comment_on", "Preview comment is hidden"),
|
|
|
|
StringResource("revanced_hide_preview_comment_off", "Preview comment is shown")
|
2023-05-10 01:04:06 +02:00
|
|
|
)
|
2022-10-25 23:33:49 +02:00
|
|
|
),
|
2023-05-15 09:51:43 +02:00
|
|
|
StringResource("revanced_comments_preference_screen_summary", "Manage the visibility of comments section components")
|
2022-10-25 23:33:49 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
2023-06-18 01:47:31 +02:00
|
|
|
}
|