mirror of
https://github.com/revanced/revanced-patches
synced 2024-11-10 09:59:21 +01:00
feat(youtube/theme): add option to color the seekbar
This commit is contained in:
parent
c363997568
commit
53b91fe2b5
@ -23,6 +23,7 @@ class ThemePatch : ResourcePatch {
|
|||||||
override fun execute(context: ResourceContext): PatchResult {
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
val darkThemeBackgroundColor = darkThemeBackgroundColor!!
|
val darkThemeBackgroundColor = darkThemeBackgroundColor!!
|
||||||
val lightThemeBackgroundColor = lightThemeBackgroundColor!!
|
val lightThemeBackgroundColor = lightThemeBackgroundColor!!
|
||||||
|
val darkThemeSeekbarColor = darkThemeSeekbarColor!!
|
||||||
|
|
||||||
context.xmlEditor["res/values/colors.xml"].use { editor ->
|
context.xmlEditor["res/values/colors.xml"].use { editor ->
|
||||||
val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element
|
val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element
|
||||||
@ -35,15 +36,17 @@ class ThemePatch : ResourcePatch {
|
|||||||
"yt_black4", "yt_status_bar_background_dark", "material_grey_850" -> darkThemeBackgroundColor
|
"yt_black4", "yt_status_bar_background_dark", "material_grey_850" -> darkThemeBackgroundColor
|
||||||
|
|
||||||
"yt_white1", "yt_white1_opacity95", "yt_white1_opacity98", "yt_white2", "yt_white3", "yt_white4",
|
"yt_white1", "yt_white1_opacity95", "yt_white1_opacity98", "yt_white2", "yt_white3", "yt_white4",
|
||||||
-> lightThemeBackgroundColor
|
-> lightThemeBackgroundColor
|
||||||
|
|
||||||
|
"inline_time_bar_colorized_bar_played_color_dark" -> darkThemeSeekbarColor
|
||||||
else -> continue
|
else -> continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// copies the resource file to change the splash screen color
|
// copies the resource file to change the splash screen color
|
||||||
context.copyResources("theme",
|
context.copyResources(
|
||||||
|
"theme",
|
||||||
ResourceUtils.ResourceGroup("values-night-v31", "styles.xml")
|
ResourceUtils.ResourceGroup("values-night-v31", "styles.xml")
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -68,5 +71,14 @@ class ThemePatch : ResourcePatch {
|
|||||||
description = "The background color of the light theme. Can be a hex color or a resource reference.",
|
description = "The background color of the light theme. Can be a hex color or a resource reference.",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var darkThemeSeekbarColor: String? by option(
|
||||||
|
PatchOption.StringOption(
|
||||||
|
key = "darkThemeSeekbarColor",
|
||||||
|
default = "#ffff0000",
|
||||||
|
title = "Dark theme seekbar color",
|
||||||
|
description = "The background color of the seekbar of the dark theme. Leave empty for default color.",
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user