cordova-plugin-statusbar icon indicating copy to clipboard operation
cordova-plugin-statusbar copied to clipboard

Android 35 StatusBarOverlaysWebView false not working

Open mannisc opened this issue 1 year ago • 3 comments

Bug Report

Problem

I have an Android API 35 Emulator (Pixel 8 Pro API 35) and StatusBarOverlaysWebView set to false in config.xml. The content of the webview is behind the statusbar (and notch, which would be okay). With Android API 34 and the same device (Pixel 8 Pro API 34) the content is below the statusbar. Also the Android navigation Item (line) in the bottom is not overlayed.

What is expected to happen?

With Android API 35 the statusbar should also be respected if StatusBarOverlaysWebView is set to false (and also the navigation at the bottom)

What does actually happen?

The App is fullscreen and underneath the statusbar.

Information

Create Pixel 8 Pro API 35 Emulator and set StatusBarOverlaysWebView to false.

Command or Code

Environment, Platform, Device

Version information

Latest cordova and cordova-plugin-statusbar versions.

Checklist

  • [x] I searched for existing GitHub issues
  • [x] I updated all Cordova tooling to most recent version
  • [x] I included all the necessary information above

mannisc avatar Sep 24 '24 10:09 mannisc

@mannisc we experience the same behavior. to be more precise We also have StatusBarOverlaysWebView set to false in config.xml.

Wenn we build our App with android-targetSdkVersion ste to 35 with 35.0.0 Buildtools and deploy it to an Api 35 emulator the webviewcontent is behind the statusbar.

This is a Behaviorchange in Android 15 https://developer.android.com/about/versions/15/behavior-changes-15#edge-to-edge

We hope the statusbar plugin can address this behavior change

ksch10bob avatar Sep 25 '24 17:09 ksch10bob

I have the same problem. Did you manged to fix this?

cmartin81 avatar Oct 21 '24 09:10 cmartin81

@mannisc and @ksch10bob I did managed to fix it temporarily. I added the following inside the config.xml file:

        <config-file parent="/resources/style" target="app/src/main/res/values/themes.xml">
            <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
        </config-file>

cmartin81 avatar Oct 21 '24 12:10 cmartin81

@cmartin81 seems like a solution and not a temporarily fix to me. Thanks for that.

ksch10bob avatar Oct 29 '24 12:10 ksch10bob

@cmartin81 @ksch10bob Even with that setting enabled, Admob interstitials take up the notch and status bar. If you use location on some Xiaomi devices, the location indicator is overexposed to the closing X of the interstitial and makes it difficult to close the ad. Does anyone have a solution? 392993418-66c05c89-42ea-49f2-9379-bb65094ad52b

repotoolsapps avatar Dec 10 '24 01:12 repotoolsapps

Wouldn't the Admob interstitials be it's own native view? It would have to manage safe area insets themselves it is. So it would be a problem with the admob library, or the plugin (whatever builds and controls the native view container that holds the ad). Likely the plugin is simply using an old version of the admob plugin.

I'm hiding both of these messages cause they are off-topic to the StatusBarOverlaysWebView issue.

breautek avatar Dec 10 '24 14:12 breautek

Is this update is for new feature of android 35 with edge to edge issues? I have two issues with Google Play, one of them is for Background Color of statusbar and the other for edge-to-edge. Should I update to new version of plugin, I am using version 3.0.0. Many thanks

BenLaKnet avatar Dec 19 '24 05:12 BenLaKnet

One or more of the APIs you use or parameters you have defined for edge view and window view have been deprecated in Android 15. Your app uses the following deprecated APIs or parameters:

android.view.Window.setStatusBarColor

They start in the following places:

org.apache.cordova.statusbar.StatusBar.setStatusBarBackgroundColor

org.apache.cordova.statusbar.StatusBar.setStatusBarTransparent

To prepare for the move to Android 15, please stop using these APIs or parameters.

rcasunshare avatar Dec 19 '24 17:12 rcasunshare

I have this message too in Google Play. Should I stop to use this plugin or just setStatusBarXXX ?

BenLaKnet avatar Dec 20 '24 03:12 BenLaKnet

Help...

BenLaKnet avatar Dec 28 '24 05:12 BenLaKnet

@ksch10bob android:windowOptOutEdgeToEdgeEnforcement is a temporary solution, as it is outlined in the document that it will be disabled in the future.

aotoriii avatar Jan 11 '25 03:01 aotoriii

I had come across the same issue after upgrading to Cordova Android 13. I tried to upgrade to the newly released Cordova Android 14, and the status bar appears to now be working as expected on my Pixel 7a (Android 15) with the StatusBarOverlaysWebView set to false.

Jkryv3nchuk avatar Apr 10 '25 20:04 Jkryv3nchuk

I have this message too: What could we do?

One or more of the APIs you use or parameters you have defined for edge view and window view have been deprecated in Android 15. Your app uses the following deprecated APIs or parameters:

android.view.Window.setStatusBarColor

They start in the following places:

org.apache.cordova.statusbar.StatusBar.setStatusBarBackgroundColor

org.apache.cordova.statusbar.StatusBar.setStatusBarTransparent

To prepare for the move to Android 15, please stop using these APIs or parameters.

BenLaKnet avatar Jun 25 '25 03:06 BenLaKnet

@BenLaKnet This is just a deprecation warning. This can be fixed in a later release and should currently not bother you because edge-to-edge is disabled for cordova-android 14 and this is allowed when the app is compiled against Android 15 (SDK 35). This must be fixed, when you compile against Android 16 (SDK 36).

GitToTheHub avatar Jun 25 '25 11:06 GitToTheHub

Many thanks @GitToTheHub

BenLaKnet avatar Jun 26 '25 01:06 BenLaKnet

The solution is to use cordova-android 14, which was released on 26.03.2025

GitToTheHub avatar Jun 26 '25 07:06 GitToTheHub