mirror of
https://github.com/revanced/revanced-patches
synced 2024-09-03 04:56:05 +02:00
feat(youtube/theme): extend theming to splash screen (#769)
This commit is contained in:
parent
5be3ecfb82
commit
f7bb937ef2
@ -9,6 +9,8 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.layout.theme.annotations.ThemeCompatibility
|
||||
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||
import app.revanced.util.resources.ResourceUtils
|
||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
import org.w3c.dom.Element
|
||||
|
||||
@Patch
|
||||
@ -31,16 +33,22 @@ class ThemePatch : ResourcePatch {
|
||||
node.textContent = when (node.getAttribute("name")) {
|
||||
"yt_black1", "yt_black1_opacity95", "yt_black1_opacity98", "yt_black2", "yt_black3", "yt_black4",
|
||||
"yt_status_bar_background_dark", "material_grey_100", "material_grey_50", "material_grey_600",
|
||||
"material_grey_800", "material_grey_850", "material_grey_900", "material_grey_white_1000" -> darkThemeBackgroundColor
|
||||
"material_grey_800", "material_grey_850", "material_grey_900", "material_grey_white_1000",
|
||||
"sud_glif_v3_dialog_background_color_dark" -> darkThemeBackgroundColor
|
||||
|
||||
"yt_white1", "yt_white1_opacity95", "yt_white1_opacity98", "yt_white2", "yt_white3",
|
||||
"yt_white4" -> lightThemeBackgroundColor
|
||||
"yt_white4", "sud_glif_v3_dialog_background_color_light" -> lightThemeBackgroundColor
|
||||
|
||||
else -> continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// copies the resource file to change the splash screen color
|
||||
context.copyResources("theme",
|
||||
ResourceUtils.ResourceGroup("values-night-v31", "styles.xml")
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
|
8
src/main/resources/theme/values-night-v31/styles.xml
Normal file
8
src/main/resources/theme/values-night-v31/styles.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="Base.Theme.YouTube.Launcher" parent="@style/Theme.AppCompat.NoActionBar">
|
||||
<item name="android:windowSplashScreenBackground">@android:color/black</item>
|
||||
<item name="android:windowSplashScreenAnimatedIcon">@drawable/avd_anim</item>
|
||||
<item name="android:windowSplashScreenAnimationDuration">1000</item>
|
||||
</style>
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user