mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 21:27:43 +02:00
add custom-double-tap-length
patch
This commit is contained in:
@ -14,8 +14,8 @@ import app.revanced.patches.shared.annotation.YouTubeCompatibility
|
||||
import app.revanced.patches.shared.patch.options.PatchOptions
|
||||
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.video.customspeed.bytecode.patch.CustomVideoSpeedBytecodePatch
|
||||
import app.revanced.util.resources.ResourceHelper.addSpeedEntries
|
||||
import app.revanced.util.resources.ResourceHelper.addSpeedEntryValues
|
||||
import app.revanced.util.resources.ResourceHelper.addEntries
|
||||
import app.revanced.util.resources.ResourceHelper.addEntryValues
|
||||
import app.revanced.util.resources.ResourceUtils.copyXmlNode
|
||||
|
||||
@Patch
|
||||
@ -45,8 +45,8 @@ class CustomVideoSpeedPatch : ResourcePatch {
|
||||
if (splits.isEmpty()) throw IllegalArgumentException("Invalid speed elements")
|
||||
val speedElements = splits.map { it }
|
||||
for (index in 0 until splits.count()) {
|
||||
context.addSpeedEntries(speedElements[index] + "x")
|
||||
context.addSpeedEntryValues(speedElements[index])
|
||||
context.addEntries(TARGET_ARRAY_PATH, speedElements[index] + "x", TARGET_ENTRY_VALUE_NAME)
|
||||
context.addEntryValues(TARGET_ARRAY_PATH, speedElements[index], TARGET_ENTRIES_NAME)
|
||||
}
|
||||
|
||||
/*
|
||||
@ -63,4 +63,9 @@ class CustomVideoSpeedPatch : ResourcePatch {
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
private companion object {
|
||||
private const val TARGET_ARRAY_PATH = "res/values/arrays.xml"
|
||||
private const val TARGET_ENTRIES_NAME = "revanced_custom_video_speed_entry"
|
||||
private const val TARGET_ENTRY_VALUE_NAME = "revanced_custom_video_speed_entry_value"
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user