Skip to content

fix(statusbar): hide status bar correctly - #2000

Open
GitToTheHub wants to merge 1 commit into
masterfrom
pr-fix-hide-statusbar
Open

fix(statusbar): hide status bar correctly#2000
GitToTheHub wants to merge 1 commit into
masterfrom
pr-fix-hide-statusbar

Conversation

@GitToTheHub

Copy link
Copy Markdown
Contributor

Platforms affected

Motivation and Context

Calling window.statusbar.visible = false sets the background of the statusbar transparent, but the content of the statusbar is still visible (clock, connectivity, battery and such). The webapp content fills the freed-up space, but now overlaps with the remaining statusbar content. When the user slides down from the top, nothing happens. There's no way to make the statusbar content disappear.

Description

Generated-By: GPT-5.6 Terra

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

- Hide the real Android status bar through the built-in API and allow it to be temporarily revealed by swipe. Respect the system status-bar visibility when calculating Cordova's faux status-bar inset, preserving compatibility with cordova-plugin-statusbar.
- Fixes #592

Generated-By: GPT-5.6 Terra
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.20%. Comparing base (807c64c) to head (05191da).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2000   +/-   ##
=======================================
  Coverage   63.20%   63.20%           
=======================================
  Files          24       24           
  Lines        4922     4922           
=======================================
  Hits         3111     3111           
  Misses       1811     1811           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dpogue

dpogue commented Aug 11, 2026

Copy link
Copy Markdown
Member

Confirm that this matches the behaviour on iOS, because I'm pretty sure it only hides the background there.

The intention for apps that want to do more complex things with the status bar (such as hiding it entirely) was to use either Fullscreen preference or to use the StatusBar plugin. The built-in status bar support was just meant to cover the most common simple cases of setting a background colour and having it push down the webview or not.

@GitToTheHub

Copy link
Copy Markdown
Contributor Author

Confirm that this matches the behaviour on iOS, because I'm pretty sure it only hides the background there.

I checked this with the cordova-ios master, not using cordova-plugin-statusbar and calling window.statusbar.visible = false. The status bar is completely hidden:

It would be a little bit confusing calling window.statusbar.visible = false and it would only hide the status bar background. If this was meant to just hide the background it should be called window.statusbar.backgroundVisible.

Also calling StatusBar.hide() on cordova-plugin-statusbar by using cordova-android 15.1.0 will leave a gray space at the top:

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.

Cordova Android 15 - Hiding the statusbar: difference between StatusBar plugin and integrated functionality

3 participants