Skip to content

fix(SystemBars): use native safe area insets on Android#8384

Merged
theproducer merged 11 commits intomainfrom
fix/RMET-4978
Mar 16, 2026
Merged

fix(SystemBars): use native safe area insets on Android#8384
theproducer merged 11 commits intomainfrom
fix/RMET-4978

Conversation

@theproducer
Copy link
Copy Markdown
Contributor

@theproducer theproducer commented Mar 10, 2026

Description

This PR implements native safe area inset handling as demonstrated in https://github.com/capacitor-community/safe-area

(CSS Safe Area vars are still intact for OS upstream)

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation

Rationale / Problems Fixed

closes #8343
closes #8329
closes #8287

Tests or Reproductions

Screenshots / Media

Platforms Affected

  • Android
  • iOS
  • Web

Notes / Comments

@theproducer theproducer changed the title Fix/rmet 4978 fix(Systembars): use native safe area insets on Android Mar 10, 2026
@theproducer theproducer changed the title fix(Systembars): use native safe area insets on Android fix(SystemBars): use native safe area insets on Android Mar 10, 2026
@theproducer theproducer marked this pull request as ready for review March 10, 2026 15:52
@theproducer theproducer requested a review from a team March 10, 2026 19:03
@OS-pedrogustavobilro OS-pedrogustavobilro self-assigned this Mar 12, 2026
Copy link
Copy Markdown
Contributor

@OS-pedrogustavobilro OS-pedrogustavobilro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments on stuff I noticed while looking at the existing community safe-areas plugin.

@OS-pedrogustavobilro OS-pedrogustavobilro self-requested a review March 13, 2026 15:45
Copy link
Copy Markdown
Contributor

@OS-pedrogustavobilro OS-pedrogustavobilro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on several apps shared across different GitHub issues, as well as a few internal apps, all seems to be working well. Very nice!

@theproducer theproducer merged commit 4e99598 into main Mar 16, 2026
6 checks passed
@theproducer theproducer deleted the fix/RMET-4978 branch March 16, 2026 21:38
@tafelnl
Copy link
Copy Markdown

tafelnl commented Mar 18, 2026

Awesome! Thank you so much for working on this and merging it! 🚀

A few points I'd like to discuss:

Thanks again for your work on this. Cheers!

@optimix
Copy link
Copy Markdown

optimix commented Mar 18, 2026

I tested today's version of SystemBars.java and noticed that the webView is now always becoming smaller when the keyboard is being shown (compared to the version 8.2.0).
Is there any setting to display the keyboard on top of the webView and leave the webView size unchanged ?
I thought that setting android:windowSoftInputMode="adjustNothing" would help achieving this but this is not the case.

@optimix
Copy link
Copy Markdown

optimix commented Mar 22, 2026

I had an issue with the latest code: the UI was jumping at startup because shouldPassthroughInsets is false at the beginning and then set to true once the onDOMReady() and then runOnUiThread() finish setting hasViewportCover.
I did a small change on my end to bypass this: 745560c

In order to programatically control the behaviour of resizing the web view or not when the keyboard changes, here is an example with a new setResizeWebViewMode() function allowing to control this:
0b4283d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants