fix(statusbar): restore StatusBarOverlaysWebView support in non-edge-to-edge mode - #1991
GitToTheHub wants to merge 1 commit into
Conversation
…e-to-edge mode - When using cordova-plugin-statusbar in cordova-android 14.0.1, the status bar overlays the web view by default and a translucent color can be set. Also the setting can be controlled by the preference `StatusBarOverlaysWebView` in `config.xml`. This was restored for cordova-android 15
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1991 +/- ##
=======================================
Coverage 63.20% 63.20%
=======================================
Files 24 24
Lines 4922 4922
=======================================
Hits 3111 3111
Misses 1811 1811 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
As previously mentioned, this should really be controlled by Currently, the Android WebView doesn't expose the viewport-fit value to us, so what we'd need to do is set up a MutationObserver in JavaScript to observe the value and toggle things in platform code using an internal API. |
|
I try to understand something about the status bar. When I set
This is the same behaviour without the plugin when |
I understand. But since we support for iOS the config.xml preference |
Platforms affected
Motivation and Context
cordova-plugin-statusbarwithcordova-android@14.0.1, the status bar overlays the web view by default and a translucent color can be set. Also the setting can be controlled by the preferenceStatusBarOverlaysWebViewinconfig.xml. This PR restores the behaviour.StatusBarOverlaysWebViewwill be only applied, when the status bar plugin is added or the app is not in edge-to-edge modeNotes
@dpogue mentioned, that this should be done by
<meta name="viewport" content="viewport-fit=cover|contain">by a MutationObserver in JavaScript. On iOS this behaviour can already be obtained by using<meta name="viewport" content="viewport-fit=cover“>. @dpogue opened PR #2010 on cordova-android which would resolve this.Sample
Configuration:
<preference name="StatusBarBackgroundColor" value="#22ff0000" />inconfig.xmlRestored behaviour in this PR:
Description
Testing
Checklist
(platform)if this change only applies to one platform (e.g.(android))