feat!: add partial night & day theme support #1818
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
cdv_*
to avoid issues caused by plugins that either create or modify the same files.This should also:
Resolves #1485
Cover SplashScreen & Background Color. (SystemBars, such as Status Bar & Gesture/Navigation Bar, will be handled in a separate PR)
Description
res/values/cdv_colors.xml
colors.xml
.cdv_background_color
set to#FAF8FF
. Same values as SDK 34+.cdv_splashscreen_background
set to@color/cdv_background_color
to match background color.res/values-v34/cdv_colors.xml
cdv_background_color
set to@android:color/system_background_light
.cdv_splashscreen_background
set to@color/cdv_background_color
to match background color.res/values-night/cdv_colors.xml
cdv_background_color
set to#121318
. Same values as SDK 34+.cdv_splashscreen_background
set to@color/cdv_background_color
to match background color.res/values-night-v34/cdv_colors.xml
cdv_background_color
set to@android:color/system_background_dark
.cdv_splashscreen_background
set to@color/cdv_background_color
to match background color.res/values/cdv_themes.xml
themes.xml
.postSplashScreenTheme
default value@style/Theme.Cordova.App.DayNight
.Theme.Cordova.App.DayNight
new theme withandroid:colorBackground
set to@color/cdv_background_color
res/values/cdv_strings.xml
cdv_strings.xml
.SplashScreen background color can be set by the following preferences, in the order of priority:
AndroidWindowSplashScreenBackground
SplashScreenBackgroundColor
BackgroundColor
Previously when the preferences was set and
cordova prepare
was executed,colors.xml
would have been updated.Now,
cdv_themes.xml
would be updated instead with the#RRGGBB
or#AARRGGBB
value inserted into the SplashScreenswindowSplashScreenBackground
. Since Cordova only accepted one color value for the SplashScreen background, it was easier to change the theme instead of the four colors resource files.Testing
npm t
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)