mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 05:07:41 +02:00
clean up
This commit is contained in:
@ -130,10 +130,19 @@ class SettingsPatch : AbstractSettingsResourcePatch(
|
||||
category: CategoryType,
|
||||
key: String,
|
||||
defaultValue: String
|
||||
) {
|
||||
addMusicPreference(category, key, defaultValue, "")
|
||||
}
|
||||
|
||||
internal fun addMusicPreference(
|
||||
category: CategoryType,
|
||||
key: String,
|
||||
defaultValue: String,
|
||||
dependencyKey: String
|
||||
) {
|
||||
val categoryValue = category.value
|
||||
contexts.addMusicPreferenceCategory(categoryValue)
|
||||
contexts.addMusicPreference(categoryValue, key, defaultValue)
|
||||
contexts.addMusicPreference(categoryValue, key, defaultValue, dependencyKey)
|
||||
}
|
||||
|
||||
internal fun addMusicPreferenceWithoutSummary(
|
||||
@ -146,6 +155,13 @@ class SettingsPatch : AbstractSettingsResourcePatch(
|
||||
contexts.addMusicPreferenceWithoutSummary(categoryValue, key, defaultValue)
|
||||
}
|
||||
|
||||
internal fun addMusicPreferenceWithIntent(
|
||||
category: CategoryType,
|
||||
key: String
|
||||
) {
|
||||
addMusicPreferenceWithIntent(category, key, "")
|
||||
}
|
||||
|
||||
internal fun addMusicPreferenceWithIntent(
|
||||
category: CategoryType,
|
||||
key: String,
|
||||
|
@ -14,7 +14,6 @@ import app.revanced.patches.music.utils.sponsorblock.bytecode.fingerprints.Music
|
||||
import app.revanced.patches.music.utils.sponsorblock.bytecode.fingerprints.MusicPlaybackControlsTimeBarOnMeasureFingerprint
|
||||
import app.revanced.patches.music.utils.sponsorblock.bytecode.fingerprints.SeekbarOnDrawFingerprint
|
||||
import app.revanced.patches.music.video.information.patch.VideoInformationPatch
|
||||
import app.revanced.patches.music.utils.videoinformation.patch.VideoInformationPatch
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction3rc
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
@ -26,7 +25,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
@DependsOn(
|
||||
[
|
||||
SharedResourceIdPatch::class,
|
||||
VideoInformationPatch::class,
|
||||
VideoInformationPatch::class
|
||||
]
|
||||
)
|
||||
|
@ -110,7 +110,8 @@ internal object MusicResourceHelper {
|
||||
internal fun ResourceContext.addMusicPreference(
|
||||
category: String,
|
||||
key: String,
|
||||
defaultValue: String
|
||||
defaultValue: String,
|
||||
dependencyKey: String
|
||||
) {
|
||||
this.xmlEditor[YOUTUBE_MUSIC_SETTINGS_PATH].use { editor ->
|
||||
val tags = editor.file.getElementsByTagName(YOUTUBE_MUSIC_PREFERENCE_SCREEN_TAG_NAME)
|
||||
@ -122,6 +123,9 @@ internal object MusicResourceHelper {
|
||||
setAttribute("android:summary", "@string/$key" + "_summary")
|
||||
setAttribute("android:key", key)
|
||||
setAttribute("android:defaultValue", defaultValue)
|
||||
if (dependencyKey != "") {
|
||||
setAttribute("android:dependency", dependencyKey)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -141,7 +145,9 @@ internal object MusicResourceHelper {
|
||||
setAttribute("android:title", "@string/$key" + "_title")
|
||||
setAttribute("android:summary", "@string/$key" + "_summary")
|
||||
setAttribute("android:key", key)
|
||||
setAttribute("android:dependency", dependencyKey)
|
||||
if (dependencyKey != "") {
|
||||
setAttribute("android:dependency", dependencyKey)
|
||||
}
|
||||
this.adoptChild("intent") {
|
||||
setAttribute("android:targetPackage", targetPackage)
|
||||
setAttribute("android:data", key)
|
||||
|
Reference in New Issue
Block a user