Skip to content

fix: simplify edge-to-edge preference logic in CordovaActivity and SystemBarPlugin#1902

Merged
GitToTheHub merged 1 commit into
apache:masterfrom
seamlink-dev:master
Apr 20, 2026
Merged

fix: simplify edge-to-edge preference logic in CordovaActivity and SystemBarPlugin#1902
GitToTheHub merged 1 commit into
apache:masterfrom
seamlink-dev:master

Conversation

@seamlink-aalves

Copy link
Copy Markdown
Contributor

Simplify edge-to-edge preference logic

Platforms affected

Android

Motivation and Context

The motivation and context was described here: apache/cordova-discuss#114

When having cordova android in Edge To Edge the app does not extend to the full height of the device in version bellow Android 15. This change allows the app to behave the same way it was possible to do with the statusbar plugin preference StatusBarOverlaysWebView given that this stopped having any effect in cordova-android 15.

Description

This PR removes the limitation for Android version <15 when preference AndroidEdgeToEdge is true.

Testing

Tested in Android 12, 13 and 16

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

@GitToTheHub
GitToTheHub merged commit 190076b into apache:master Apr 20, 2026
@erisu

erisu commented Apr 21, 2026

Copy link
Copy Markdown
Member

This appears to have introduce an issue on Android 7 where content is rendered behind the navigation bar, which should not happen, and results in parts of the page not being visible.

While I understand the idea is to try and re-implement the behavior of StatusBarOverlaysWebView, which only affect the statusbar, I think it would have been easier to add back the preference and only update only the top margin.

Android’s edge-to-edge behavior on the other hand would applies to both the status bar and the navigation bar, while E2E was not the original behavior of the previous preference.

@GitToTheHub

Copy link
Copy Markdown
Contributor

This appears to have introduce an issue on Android 7 where content is rendered behind the navigation bar, which should not happen, and results in parts of the page not being visible.

If this only affects Android 7, maybe we can set the minimum Android to 8?

@GitToTheHub

Copy link
Copy Markdown
Contributor

While I understand the idea is to try and re-implement the behavior of StatusBarOverlaysWebView, which only affect the statusbar, I think it would have been easier to add back the preference and only update only the top margin.

I think you are right. It's confusing to enable AndroidEdgeToEdge for Android versions pre 15. It should have no effect on Android < 15. Would you make a PR for it?

@GitToTheHub

Copy link
Copy Markdown
Contributor

It would be also possible to hide the statusbar by the new Status Bar JS API window.statusbar.visible = false; when fullscreen is required and the Android EdgeToEdge logic is only applied on Android 15 and newer.

@GitToTheHub

Copy link
Copy Markdown
Contributor

I opened PR #1962, which will revert this PR.

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.

3 participants