Skip to content

[android] StatusBarOverlaysWebView defaults to true not work {broken} #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
mosabab opened this issue Nov 8, 2019 · 21 comments · Fixed by #171
Closed
3 tasks done

[android] StatusBarOverlaysWebView defaults to true not work {broken} #170

mosabab opened this issue Nov 8, 2019 · 21 comments · Fixed by #171

Comments

@mosabab
Copy link

mosabab commented Nov 8, 2019

Bug Report

Problem

What is expected to happen?

The statusbar should overlay the webview.

  • According to the plugin docs:
    the preference StatusBarOverlaysWebView (boolean, defaults to true).

What does actually happen?

The status bar became in solid blank, and not overlay the webview.

  • the preference StatusBarOverlaysWebView defaults to true not working.

Information

Untitled-1

Maybe someone know how this issue can be solved !

Environment, Platform, Device

  • Any new android devices.

Version information

  • Phonegap/Cordova CLI 9.0.0 (Android 8.0.0)
  • cordova-plugin-statusbar master version.

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@mosabab
Copy link
Author

mosabab commented Nov 8, 2019

@breautek sorry for the ping, but could you please take a look into this if you have any idea?
Regards

@breautek
Copy link
Contributor

breautek commented Nov 8, 2019

You may be hitting the bug as reported at #151 where android doesn't actually read the StatusBarOverlaysWebView preference. There is a pending PR to fix that, but with requested changes, and the author of the PR hasn't responded in quite awhile.

Workaround described at #151 (comment)

@mosabab
Copy link
Author

mosabab commented Nov 8, 2019

You may be hitting the bug as reported at #151 where android doesn't actually read the StatusBarOverlaysWebView preference. There is a pending PR to fix that, but with requested changes, and the author of the PR hasn't responded in quite awhile.

Workaround described at #151 (comment)

Thanks for reply,

Does this issue is the same old issue for ios before we add view-fit=cover to support ios ?

@mosabab
Copy link
Author

mosabab commented Nov 8, 2019

Why the pending PR still in request because who made the PR still not respond, I think anyone who is familiar with these codes can make a new PR and then done by approved, because this is high priority bug that need to be solved.

@mosabab mosabab changed the title [android] statusbar plugin does not support notch devices [android] StatusBarOverlaysWebView default to true not work Nov 8, 2019
@mosabab mosabab changed the title [android] StatusBarOverlaysWebView default to true not work [android] StatusBarOverlaysWebView defaults to true not work Nov 8, 2019
@mosabab mosabab changed the title [android] StatusBarOverlaysWebView defaults to true not work [android] StatusBarOverlaysWebView defaults to true not work {broken} Nov 8, 2019
@breautek
Copy link
Contributor

breautek commented Nov 9, 2019

Does this issue is the same old issue for ios before we add view-fit=cover to support ios ?

Not sure what old issue you are referring to, but the issue I linked is an android issue only. iOS has always read the preference. I believe the source of the problem is the feature was implemented for iOS only originally.

Why the pending PR still in request because who made the PR still not respond

Because Cordova is 100% volunteer based and many of us is very busy.

I think anyone who is familiar with these codes can make a new PR and then done by approved

I agree, and honestly the changes required to fix #151 issue is rather trivial, PRs welcome, even if there is already a pending one.

But to confirm that this is even the problem that you are facing, I would use the JS API to set statusbar overlay to enable the statusbar. If that makes the statusbar work as expected, then we can confidently say that you were hitting the same issue as #151.

@mosabab
Copy link
Author

mosabab commented Nov 9, 2019

You are true.
I try yo use JS API and i will tell you if it work or not.

Regards

@mosabab
Copy link
Author

mosabab commented Nov 10, 2019

Hello @breautek
I add js api and it work, but i think this just temporary solution and not the optimal.
Maybe someone can solve this issue soon.
Regards

@breautek
Copy link
Contributor

Yes, this was just a confirmation that you weren't experiencing a different problem than #151

@diamond95
Copy link

Hello @breautek
I add js api and it work, but i think this just temporary solution and not the optimal.
Maybe someone can solve this issue soon.
Regards

Can you show me example how it works for you?

@mosabab
Copy link
Author

mosabab commented Nov 18, 2019

Hello @breautek
I add js api and it work, but i think this just temporary solution and not the optimal.
Maybe someone can solve this issue soon.
Regards

Can you show me example how it works for you?

Hello @diamond95

You can add StatusBar.overlaysWebView(true); after deviceready event fires.

for e.g.:

document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {

StatusBar.overlaysWebView(true);

//......... other codes........
}

@diamond95
Copy link

@mosababubakr well, it does not work for me when I compile mobile application on android 9

@mosabab
Copy link
Author

mosabab commented Nov 18, 2019

@mosababubakr well, it does not work for me when I compile mobile application on android 9

did you try to put the following code and not work ?

function onDeviceReady() {

StatusBar.overlaysWebView(true);

//......... other codes........
}

... if not work, then maybe @breautek could find the answer for this (android 9)

@diamond95
Copy link

@mosababubakr I did already open bug, #155

@mosabab
Copy link
Author

mosabab commented Nov 18, 2019

@diamond95

did you used the master version of the plugin ?
do you used the latest cli for phonegap/ cordova ?

@diamond95
Copy link

@mosababubakr Yup. Can you push to github some example with working status bar ? I would like to check that..

Thanks anyway

@mosabab
Copy link
Author

mosabab commented Nov 18, 2019

@diamond95

  • I just put <preference name="StatusBarOverlaysWebView" value="true" /> in the config.xml file.
  • I put the following code in onDeviceReady() function like this:

function onDeviceReady() {

StatusBar.overlaysWebView(true);

}

  • I use the master version of the plugin.
  • I use phonegap build to build the app and set phonegap version to phonegap cli 9.0.0 (aka: cordova cli 9.0.0)

@breautek
Copy link
Contributor

StatusBar.overlaysWebView(true); may not consistently work properly when called from the deviceready. There is some sort of race condition. I don't see it on my production apps, but on simple apps I do see the issue. That issue is being tracked at #158

Currently <preference name="StatusBarOverlaysWebView" value="true" /> does nothing for android, as android doesn't read the preference value. The PR #171 will address this issue, but is only expected to land in master when prepping for the next major release.

So far the best way to avoid #158 is to apply #171 PR to your own fork so that you can use the StatusBarOverlaysWebView preference. In my testing, the status bar appears to consistently work as expected when the overlay is being applied in the plugin initialisation.

@mosabab
Copy link
Author

mosabab commented Nov 18, 2019

StatusBar.overlaysWebView(true); may not consistently work properly when called from the deviceready. There is some sort of race condition. I don't see it on my production apps, but on simple apps I do see the issue. That issue is being tracked at #158

Currently <preference name="StatusBarOverlaysWebView" value="true" /> does nothing for android, as android doesn't read the preference value. The PR #171 will address this issue, but is only expected to land in master when prepping for the next major release.

So far the best way to avoid #158 is to apply #171 PR to your own fork so that you can use the StatusBarOverlaysWebView preference. In my testing, the status bar appears to consistently work as expected when the overlay is being applied in the plugin initialisation.

when the PR will be merged and done if it ready ?

@breautek
Copy link
Contributor

breautek commented Nov 18, 2019

when the PR will be merged and done if it ready ?

#171 is a breaking change, even though it's fixing a bug because it's changing the default behaviour of the android platform, so the PR will only be merged once preparations for the next major starts. I can't really give a timeline when that will happen, but there are a few other PRs also waiting for a major version bump.

I still have one thing outstanding task for #171 but I'm planning on making that commit tonight.

@WuglyakBolgoink
Copy link

03.2020 nothing happen... Ping?!

@maswerdna
Copy link

What's the update on this? Is anyone still working on something?

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 a pull request may close this issue.

5 participants