Skip to content

chore(config.xml): add StatusBarBackgroundColor, update BackgroundColor and AndroidEdgeToEdge#1502

Open
GitToTheHub wants to merge 15 commits into
masterfrom
pr-feat-config.xml-add-StatusBarBackgroundColor-update-BackgroundColor
Open

chore(config.xml): add StatusBarBackgroundColor, update BackgroundColor and AndroidEdgeToEdge#1502
GitToTheHub wants to merge 15 commits into
masterfrom
pr-feat-config.xml-add-StatusBarBackgroundColor-update-BackgroundColor

Conversation

@GitToTheHub

@GitToTheHub GitToTheHub commented May 21, 2026

Copy link
Copy Markdown
Contributor

Platforms affected

  • Android
  • iOS

Motivation and Context

Description

Testing

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

…ml`, update `BackgroundColor` regarding Android

- `StatusBarBackgroundColor` is handled since cordova-android 15, which is reused from cordova-plugin-statusbar. When`AndroidEdgeToEdge` is `true`, this preference may not produce a visible status bar background fill, but it can still influence status bar icon/text light-versus-dark appearance.
- Add prefernce example of`StatusBarBackgroundColor`
- Update documentation of `BackgroundColor` that on Android if `StatusBarBackgroundColor` is not set, this value is also used for the status bar. Depending on the Android OS version, this preference may also change the navigation/gesture bar. Edge case: if the value is invalid, Cordova ignores it and falls back to platform defaults/fallback colors.
- Add note to AndroidEdgeToEdge, that when it set the built-in StatusBar JavaScript API methods (such as `window.statusbar.setBackgroundColor`) are not applied.
- Generated-By: GPT-5.3-Codex
- Edge case: when `AndroidEdgeToEdge` is `true`, this preference may not produce a visible status bar background fill, but it can still influence status bar icon/text light-versus-dark appearance.
- Generated-By: GPT-5.3-Codex

@dpogue dpogue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of what you've written for Android also applies in cordova-ios 8.x

- To be more consistent it is better to use the common format #AARRGGBB instead of 0xAARRGGBB
@GitToTheHub

Copy link
Copy Markdown
Contributor Author

A bunch of what you've written for Android also applies in cordova-ios 8.x

Ok I have to check what applies also for cordova-ios 8 here

@GitToTheHub GitToTheHub changed the title feat(android): add StatusBarBackgroundColor preference to config.xml, update BackgroundColor regarding Android feat: add StatusBarBackgroundColor preference to config.xml, update BackgroundColor regarding Android Jun 13, 2026
@GitToTheHub
GitToTheHub requested a review from dpogue June 13, 2026 18:12
@GitToTheHub

GitToTheHub commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

A bunch of what you've written for Android also applies in cordova-ios 8.x

I updated the documentation for both iOS and Android and also made some adjustments.

@GitToTheHub GitToTheHub changed the title feat: add StatusBarBackgroundColor preference to config.xml, update BackgroundColor regarding Android chore: add StatusBarBackgroundColor, update BackgroundColor and AndroidEdgeToEdge Jun 24, 2026
@GitToTheHub GitToTheHub changed the title chore: add StatusBarBackgroundColor, update BackgroundColor and AndroidEdgeToEdge chore(config.xml): add StatusBarBackgroundColor, update BackgroundColor and AndroidEdgeToEdge Jun 24, 2026
@GitToTheHub GitToTheHub changed the title chore(config.xml): add StatusBarBackgroundColor, update BackgroundColor and AndroidEdgeToEdge chore(config.xml): add StatusBarBackgroundColor, update BackgroundColor, AndroidEdgeToEdge Jun 24, 2026
@GitToTheHub GitToTheHub changed the title chore(config.xml): add StatusBarBackgroundColor, update BackgroundColor, AndroidEdgeToEdge chore(config.xml): add StatusBarBackgroundColor, update BackgroundColor and AndroidEdgeToEdge Jun 24, 2026
- CSS environment variables `safe-area-inset-*` available since web view version 149
- The plugin `cordova-plugin-insets` can be used to support `safe-area-inset-*` on older web view versions
- The Status Bar JS API function `window.statusbar.setBackgroundColor()` supports any valid CSS Color
- Added link for MDN documentation for css colors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants