This is an automated email from the ASF dual-hosted git repository. erisu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cordova-android.git
The following commit(s) were added to refs/heads/master by this push: new 7fa4a65d feat(splash): Support SplashScreenBackgroundColor preference (#1700) 7fa4a65d is described below commit 7fa4a65d0a48da9561d9be0d26aa9417a75c4ca2 Author: Darryl Pogue <dar...@dpogue.ca> AuthorDate: Wed May 8 23:57:04 2024 -0700 feat(splash): Support SplashScreenBackgroundColor preference (#1700) --- lib/prepare.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/prepare.js b/lib/prepare.js index 554af6c1..5a7289e5 100644 --- a/lib/prepare.js +++ b/lib/prepare.js @@ -378,10 +378,24 @@ function updateProjectSplashScreen (platformConfig, locations) { const themes = xmlHelpers.parseElementtreeSync(locations.themes); const splashScreenTheme = themes.find('style[@name="Theme.App.SplashScreen"]'); + let splashBg = platformConfig.getPreference('AndroidWindowSplashScreenBackground', this.platform); + if (!splashBg) { + splashBg = platformConfig.getPreference('SplashScreenBackgroundColor', this.platform); + } + if (!splashBg) { + splashBg = platformConfig.getPreference('BackgroundColor', this.platform); + } + + // use the user defined value for "colors.xml" + updateProjectSplashScreenBackgroundColor(splashBg, locations); + + // force the themes value to `@color/cdv_splashscreen_background` + const splashBgNode = splashScreenTheme.find('item[@name="windowSplashScreenBackground"]'); + splashBgNode.text = '@color/cdv_splashscreen_background'; + [ 'windowSplashScreenAnimatedIcon', 'windowSplashScreenAnimationDuration', - 'windowSplashScreenBackground', 'android:windowSplashScreenBrandingImage', 'windowSplashScreenIconBackgroundColor', 'postSplashScreenTheme' @@ -392,14 +406,6 @@ function updateProjectSplashScreen (platformConfig, locations) { let themeTargetNode = splashScreenTheme.find(`item[@name="${themeKey}"]`); switch (themeKey) { - case 'windowSplashScreenBackground': - // use the user defined value for "colors.xml" - updateProjectSplashScreenBackgroundColor(cdvConfigPrefValue, locations); - - // force the themes value to `@color/cdv_splashscreen_background` - themeTargetNode.text = '@color/cdv_splashscreen_background'; - break; - case 'windowSplashScreenAnimatedIcon': // handle here the cases of "png" vs "xml" (drawable) // If "png": --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org