2023-09-20 05:33:02 +02:00
|
|
|
package app.revanced.patches.youtube.layout.hide.breakingnews
|
2022-12-29 17:42:33 +01: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.Patch
|
2024-01-27 02:34:01 +01:00
|
|
|
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
|
|
|
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
|
|
|
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
2023-09-20 05:33:02 +02:00
|
|
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
2022-12-29 17:42:33 +01:00
|
|
|
|
2023-09-20 05:33:02 +02:00
|
|
|
@Patch(
|
|
|
|
dependencies = [
|
|
|
|
SettingsPatch::class,
|
2024-01-27 02:34:01 +01:00
|
|
|
ResourceMappingPatch::class,
|
|
|
|
AddResourcesPatch::class
|
2023-09-20 05:33:02 +02:00
|
|
|
],
|
|
|
|
)
|
2023-12-02 22:35:13 +01:00
|
|
|
internal object BreakingNewsResourcePatch : ResourcePatch() {
|
2023-09-20 05:33:02 +02:00
|
|
|
internal var horizontalCardListId: Long = -1
|
2022-12-29 17:42:33 +01:00
|
|
|
|
2023-08-27 21:40:49 +02:00
|
|
|
override fun execute(context: ResourceContext) {
|
2024-01-27 02:34:01 +01:00
|
|
|
AddResourcesPatch(this::class)
|
|
|
|
|
2024-03-02 08:27:05 +01:00
|
|
|
SettingsPatch.PreferenceScreen.FEED.addPreferences(
|
|
|
|
SwitchPreference("revanced_hide_breaking_news")
|
|
|
|
)
|
2022-12-29 17:42:33 +01:00
|
|
|
|
|
|
|
horizontalCardListId = ResourceMappingPatch.resourceMappings.single {
|
|
|
|
it.type == "layout" && it.name == "horizontal_card_list"
|
|
|
|
}.id
|
|
|
|
}
|
|
|
|
}
|