feat(YouTube/Settings): move SponsorBlock settings and Return YouTube Dislike settings to RVX Settings

This commit is contained in:
inotia00
2024-04-07 09:36:28 +09:00
parent f1f22a546c
commit 0bb9e1904a
6 changed files with 93 additions and 68 deletions

View File

@ -106,9 +106,13 @@ object ReturnYouTubeDislikePatch : BaseBytecodePatch(
// endregion
/**
* Add ReVanced Extended Settings
* Add settings
*/
SettingsPatch.addPreferenceFragment("revanced_ryd_settings")
SettingsPatch.addPreference(
arrayOf(
"PREFERENCE: RETURN_YOUTUBE_DISLIKE_SETTINGS"
)
)
SettingsPatch.updatePatchStatus("Return YouTube Dislike")

View File

@ -20,7 +20,7 @@ import java.util.concurrent.Executors
import java.util.concurrent.TimeUnit
import java.util.jar.Manifest
@Suppress("DEPRECATION", "SpellCheckingInspection", "unused")
@Suppress("DEPRECATION", "unused")
object SettingsPatch : BaseResourcePatch(
name = "Settings",
description = "Applies mandatory patches to implement ReVanced Extended settings into the application.",
@ -105,6 +105,7 @@ object SettingsPatch : BaseResourcePatch(
arrayOf(
ResourceGroup(
"layout",
"revanced_settings_preferences_category.xml",
"revanced_settings_with_toolbar.xml"
),
ResourceGroup(
@ -118,7 +119,7 @@ object SettingsPatch : BaseResourcePatch(
/**
* initialize ReVanced Extended Settings
*/
addPreferenceFragment("revanced_extended_settings")
context.addPreferenceFragment("revanced_extended_settings")
/**
* remove ReVanced Extended Settings divider
@ -150,10 +151,6 @@ object SettingsPatch : BaseResourcePatch(
contexts.addPreference(settingArray)
}
internal fun addPreferenceFragment(key: String) {
contexts.addPreferenceFragment(key)
}
internal fun updatePatchStatus(patchTitle: String) {
contexts.updatePatchStatus(patchTitle)
}

View File

@ -137,9 +137,13 @@ object SponsorBlockPatch : BaseResourcePatch(
if (!modifiedControlsLayout) throw PatchException("Could not modify controls layout")
/**
* Add ReVanced Extended Settings
* Add settings
*/
SettingsPatch.addPreferenceFragment("revanced_sb_settings")
SettingsPatch.addPreference(
arrayOf(
"PREFERENCE: SPONSOR_BLOCK_SETTINGS"
)
)
SettingsPatch.updatePatchStatus("SponsorBlock")