mirror of
https://github.com/revanced/revanced-patches
synced 2024-11-10 00:29:24 +01:00
fix(YouTube - Theme): allow setting no background color
This commit is contained in:
parent
dfb7d7b3dd
commit
8a4e77a290
@ -45,8 +45,8 @@ class ThemeResourcePatch : ResourcePatch {
|
|||||||
|
|
||||||
node.textContent = when (node.getAttribute("name")) {
|
node.textContent = when (node.getAttribute("name")) {
|
||||||
"yt_black0", "yt_black1", "yt_black1_opacity95", "yt_black1_opacity98", "yt_black2", "yt_black3",
|
"yt_black0", "yt_black1", "yt_black1_opacity95", "yt_black1_opacity98", "yt_black2", "yt_black3",
|
||||||
"yt_black4", "yt_status_bar_background_dark", "material_grey_850" -> darkThemeBackgroundColor
|
"yt_black4", "yt_status_bar_background_dark", "material_grey_850"
|
||||||
?: continue
|
-> darkThemeBackgroundColor ?: continue
|
||||||
|
|
||||||
"yt_white1", "yt_white1_opacity95", "yt_white1_opacity98",
|
"yt_white1", "yt_white1_opacity95", "yt_white1_opacity98",
|
||||||
"yt_white2", "yt_white3", "yt_white4",
|
"yt_white2", "yt_white3", "yt_white4",
|
||||||
@ -58,10 +58,13 @@ class ThemeResourcePatch : ResourcePatch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add a dynamic background color to the colors.xml file.
|
// Add a dynamic background color to the colors.xml file.
|
||||||
addResourceColor(context, "res/values/colors.xml",
|
lightThemeBackgroundColor?.let {
|
||||||
SPLASH_BACKGROUND_COLOR, lightThemeBackgroundColor!!)
|
addColorResource(context, "res/values/colors.xml", SPLASH_BACKGROUND_COLOR, it)
|
||||||
addResourceColor(context, "res/values-night/colors.xml",
|
}
|
||||||
SPLASH_BACKGROUND_COLOR, darkThemeBackgroundColor!!)
|
|
||||||
|
darkThemeBackgroundColor?.let {
|
||||||
|
addColorResource(context, "res/values-night/colors.xml", SPLASH_BACKGROUND_COLOR, it)
|
||||||
|
}
|
||||||
|
|
||||||
// Edit splash screen files and change the background color.
|
// Edit splash screen files and change the background color.
|
||||||
val splashScreenResourceFiles = listOf(
|
val splashScreenResourceFiles = listOf(
|
||||||
@ -87,7 +90,7 @@ class ThemeResourcePatch : ResourcePatch {
|
|||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addResourceColor(
|
private fun addColorResource(
|
||||||
context: ResourceContext,
|
context: ResourceContext,
|
||||||
resourceFile: String,
|
resourceFile: String,
|
||||||
colorName: String,
|
colorName: String,
|
||||||
|
Loading…
Reference in New Issue
Block a user