fix(YouTube/Overlay buttons): changed to selectable through options.json
@ -5,6 +5,7 @@ import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.patch.options.types.BooleanPatchOption.Companion.booleanPatchOption
|
||||
import app.revanced.patches.youtube.overlaybutton.alwaysrepeat.AlwaysRepeatPatch
|
||||
import app.revanced.patches.youtube.overlaybutton.download.hook.DownloadButtonHookPatch
|
||||
import app.revanced.patches.youtube.overlaybutton.download.pip.DisablePiPPatch
|
||||
@ -59,6 +60,13 @@ import org.w3c.dom.Element
|
||||
)
|
||||
@Suppress("unused")
|
||||
object OverlayButtonsPatch : ResourcePatch() {
|
||||
internal var OutlineIcon by booleanPatchOption(
|
||||
key = "OutlineIcon",
|
||||
default = false,
|
||||
title = "Outline icons",
|
||||
description = "Apply the outline icon"
|
||||
)
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
|
||||
/**
|
||||
@ -78,8 +86,7 @@ object OverlayButtonsPatch : ResourcePatch() {
|
||||
/**
|
||||
* Copy arrays
|
||||
*/
|
||||
context.copyXmlNode("youtube/overlaybuttons/host", "values/arrays.xml", "resources")
|
||||
|
||||
context.copyXmlNode("youtube/overlaybuttons/shared/host", "values/arrays.xml", "resources")
|
||||
|
||||
/**
|
||||
* Copy resources
|
||||
@ -90,7 +97,35 @@ object OverlayButtonsPatch : ResourcePatch() {
|
||||
"playlist_repeat_button.xml",
|
||||
"playlist_shuffle_button.xml",
|
||||
"revanced_repeat_icon.xml"
|
||||
),
|
||||
)
|
||||
).forEach { resourceGroup ->
|
||||
context.copyResources("youtube/overlaybuttons/shared", resourceGroup)
|
||||
}
|
||||
|
||||
if (OutlineIcon == true) {
|
||||
arrayOf(
|
||||
ResourceUtils.ResourceGroup(
|
||||
"drawable-xxhdpi",
|
||||
"ic_fullscreen_vertical_button.png",
|
||||
"quantum_ic_fullscreen_exit_grey600_24.png",
|
||||
"quantum_ic_fullscreen_exit_white_24.png",
|
||||
"quantum_ic_fullscreen_grey600_24.png",
|
||||
"quantum_ic_fullscreen_white_24.png",
|
||||
"revanced_copy_icon.png",
|
||||
"revanced_copy_icon_with_time.png",
|
||||
"revanced_download_icon.png",
|
||||
"revanced_speed_icon.png",
|
||||
"yt_fill_arrow_repeat_white_24.png",
|
||||
"yt_outline_arrow_repeat_1_white_24.png",
|
||||
"yt_outline_arrow_shuffle_1_white_24.png",
|
||||
"yt_outline_screen_full_exit_white_24.png",
|
||||
"yt_outline_screen_full_white_24.png"
|
||||
)
|
||||
).forEach { resourceGroup ->
|
||||
context.copyResources("youtube/overlaybuttons/outline", resourceGroup)
|
||||
}
|
||||
} else {
|
||||
arrayOf(
|
||||
ResourceUtils.ResourceGroup(
|
||||
"drawable-xxhdpi",
|
||||
"ic_fullscreen_vertical_button.png",
|
||||
@ -111,14 +146,15 @@ object OverlayButtonsPatch : ResourcePatch() {
|
||||
"yt_outline_screen_vertical_vd_theme_24.png"
|
||||
)
|
||||
).forEach { resourceGroup ->
|
||||
context.copyResources("youtube/overlaybuttons", resourceGroup)
|
||||
context.copyResources("youtube/overlaybuttons/default", resourceGroup)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge xml nodes from the host to their real xml files
|
||||
*/
|
||||
context.copyXmlNode(
|
||||
"youtube/overlaybuttons/host",
|
||||
"youtube/overlaybuttons/shared/host",
|
||||
"layout/youtube_controls_bottom_ui_container.xml",
|
||||
"android.support.constraint.ConstraintLayout"
|
||||
)
|
||||
|
Before Width: | Height: | Size: 547 B After Width: | Height: | Size: 547 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 214 B |
After Width: | Height: | Size: 214 B |
After Width: | Height: | Size: 207 B |
After Width: | Height: | Size: 207 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 314 B After Width: | Height: | Size: 314 B |
After Width: | Height: | Size: 411 B |
Before Width: | Height: | Size: 499 B After Width: | Height: | Size: 499 B |
After Width: | Height: | Size: 214 B |
After Width: | Height: | Size: 207 B |
After Width: | Height: | Size: 547 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 719 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |