fix(YouTube - Theme): Splash screen color attribute not specified in YouTube 19.44.39

This commit is contained in:
inotia00 2025-01-22 13:13:12 +09:00
parent 0d0c108d85
commit 2f7b753551
2 changed files with 8 additions and 4 deletions

View File

@ -27,7 +27,7 @@ val sharedThemePatch = resourcePatch(
document(attrsResourceFile).use { document ->
(document.getElementsByTagName("resources").item(0) as Element).appendChild(
document.createElement("attr").apply {
setAttribute("format", "reference")
setAttribute("format", "reference|color")
setAttribute("name", SPLASH_SCREEN_COLOR_NAME)
}
)
@ -49,7 +49,7 @@ val sharedThemePatch = resourcePatch(
setAttribute(
"name",
when (pathIndex) {
0 -> "splashScreenColor"
0 -> SPLASH_SCREEN_COLOR_NAME
1 -> "android:windowSplashScreenBackground"
else -> "null"
}
@ -59,8 +59,10 @@ val sharedThemePatch = resourcePatch(
document.createTextNode(
when (pathIndex) {
0 -> when (nodeAttributeName) {
"Base.Theme.YouTube.Launcher.Dark" -> "@color/yt_black1"
"Base.Theme.YouTube.Launcher.Light" -> "@color/yt_white1"
"Base.Theme.YouTube.Launcher.Dark",
"Base.Theme.YouTube.Launcher.Cairo.Dark" -> "@color/yt_black1"
"Base.Theme.YouTube.Launcher.Light",
"Base.Theme.YouTube.Launcher.Cairo.Light" -> "@color/yt_white1"
else -> "null"
}

View File

@ -54,6 +54,7 @@ val themePatch = resourcePatch(
values = availableDarkTheme,
title = "Dark theme background color",
description = "Can be a hex color (#AARRGGBB) or a color resource reference.",
required = true,
)
val lightThemeBackgroundColor = stringOption(
@ -62,6 +63,7 @@ val themePatch = resourcePatch(
values = availableLightTheme,
title = "Light theme background color",
description = "Can be a hex color (#AARRGGBB) or a color resource reference.",
required = true,
)
execute {