2023-09-20 05:33:02 +02:00
|
|
|
package app.revanced.patches.youtube.interaction.swipecontrols
|
2022-07-11 14:29:46 +02:00
|
|
|
|
2022-10-05 04:03:10 +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.Patch
|
2024-01-27 02:34:01 +01:00
|
|
|
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
|
|
|
import app.revanced.patches.shared.misc.settings.preference.InputType
|
|
|
|
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
|
|
|
import app.revanced.patches.shared.misc.settings.preference.TextPreference
|
2023-09-20 05:33:02 +02:00
|
|
|
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
2023-12-02 22:35:13 +01:00
|
|
|
import app.revanced.util.ResourceGroup
|
|
|
|
import app.revanced.util.copyResources
|
2022-07-11 14:29:46 +02:00
|
|
|
|
2023-09-20 05:33:02 +02:00
|
|
|
@Patch(
|
2024-03-02 08:27:05 +01:00
|
|
|
dependencies = [SettingsPatch::class, AddResourcesPatch::class],
|
2023-09-20 05:33:02 +02:00
|
|
|
)
|
2023-12-02 22:35:13 +01:00
|
|
|
internal object SwipeControlsResourcePatch : ResourcePatch() {
|
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.SWIPE_CONTROLS.addPreferences(
|
|
|
|
SwitchPreference("revanced_swipe_brightness"),
|
|
|
|
SwitchPreference("revanced_swipe_volume"),
|
|
|
|
SwitchPreference("revanced_swipe_press_to_engage"),
|
|
|
|
SwitchPreference("revanced_swipe_haptic_feedback"),
|
|
|
|
SwitchPreference("revanced_swipe_save_and_restore_brightness"),
|
|
|
|
TextPreference("revanced_swipe_overlay_timeout", inputType = InputType.NUMBER),
|
|
|
|
TextPreference("revanced_swipe_text_overlay_size", inputType = InputType.NUMBER),
|
|
|
|
TextPreference("revanced_swipe_overlay_background_alpha", inputType = InputType.NUMBER),
|
|
|
|
TextPreference("revanced_swipe_threshold", inputType = InputType.NUMBER),
|
2022-08-22 01:59:43 +02:00
|
|
|
)
|
|
|
|
|
2022-10-05 04:03:10 +02:00
|
|
|
context.copyResources(
|
2022-08-22 04:58:17 +02:00
|
|
|
"swipecontrols",
|
2023-12-02 22:35:13 +01:00
|
|
|
ResourceGroup(
|
2022-08-22 04:58:17 +02:00
|
|
|
"drawable",
|
2024-01-27 02:34:01 +01:00
|
|
|
"revanced_ic_sc_brightness_auto.xml",
|
|
|
|
"revanced_ic_sc_brightness_manual.xml",
|
|
|
|
"revanced_ic_sc_volume_mute.xml",
|
2024-03-02 08:27:05 +01:00
|
|
|
"revanced_ic_sc_volume_normal.xml",
|
|
|
|
),
|
2022-07-11 14:29:46 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|