fix(SystemBars): make safe-area-inset-x available on API <= 34 - #8424
Conversation
|
Hi, thanks for this PR. |
|
@luisbytes Do you have a test app that I can play around with and test some changes against? |
|
@theproducer |
|
@theproducer Upon reviewing, I noticed that the AdMob plugin adds padding based on the safe area, but only for Android 15+. This leaves me wondering how plugins that need to display something natively on screen should handle the safe area: based on the WebView version or the Android version? I'll also leave a Playground repository. I encountered more problems with the AdMob plugin on Android 15 and 16 with WebViews lower than 140 (it works fine in the latest WebView versions). The cause is this pull request: #8384. Downgrading to 8.2.0 fixes it. In conclusion, I believe this pull request can be merged, but guidelines or suggestions should be established for plugins that want to display native objects on WebViews. For now, I applied this patch to the patch/admob branch of the admob plugin, adding native padding based on the webview version, just like the systembars plugin currently does. I tested it on Android 11, 14, 15, and 16 with Webview <140 and >140, and it works fine. I'm considering whether to submit a PR to the AdMob plugin if these changes are mixed, applying padding based on the webview version. |
|
@luisbytes I removed That should fix the immediate issue with AdMob. |
|
@theproducer Thank you very much, I will try it. One question: will |
|
@theproducer I ran a test, but nothing changed; the banner is broken. It's having double padding added to the bottom on Android 15+ with a Webview below 140. I updated the test repository.
After downgrading to @capacitor/android@8.2.0, everything works as it should. |
|
@luisbytes Can you pull the latest from this branch and see if that fixes your double padding issue? |
@theproducer I ran the test, and this last error is still occurring. It should be noted that this only happens on Android 15+ and on Webview versions lower than 140. I also updated the test repository. Applying the patch with the changes from this PR in the README contains instructions on how to run the app. |
|
@luisbytes Hmm, I was able to reproduce your issue. However, for Android 15+ in the AdMob
I obviously didn't do a full run of tests, but that might be all there is to it. |
|
Thanks, @theproducer. Maybe we should merge this and deal with the AdMob plugin later. Should |
Yes, it should, and I'll be dealing with that in the next PR. |
…-area-inset-x` available on API <= 34 (#70) * fix: injecting custom safe area insets for all Android versions * fmt * calling `WindowCompat.setDecorFitsSystemWindows` * Setting safe area insets to zero --------- Co-authored-by: Joseph Pender <joey.pender@outsystems.com> Co-authored-by: Capacitor+ Bot <bot@capgo.app>
…equest bodies (#87) * Release 8.3.2 * fix(cli): copy plugin files in CocoaPods projects (ionic-team#8467) * Release 8.3.3 * chore(cli): update telemetry endpoint (ionic-team#8464) * Release 8.3.4 * chore: format java code (ionic-team#8475) * chore: format java code (ionic-team#8477) * feat: add method getDouble to plugin config (ionic-team#7638) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * fix(SystemBars): make `safe-area-inset-x` available on API <= 34 (ionic-team#8424) * fix(http): support binary request bodies * fix(http): support binary request bodies (cherry picked from commit 5bfdb1d) Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com> --------- Co-authored-by: Github Workflow (on behalf of markemer) <users.noreply.github.com> Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> Co-authored-by: Alex J. <alexandre.jacinto@outsystems.com> Co-authored-by: Robin Genz <mail@robingenz.dev> Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: Angel J <78835633+iamanaws@users.noreply.github.com> Co-authored-by: Capacitor+ Bot <bot@capgo.app> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
…e data type generic (#85) * Release 8.3.2 * fix(cli): copy plugin files in CocoaPods projects (ionic-team#8467) * Release 8.3.3 * chore(cli): update telemetry endpoint (ionic-team#8464) * Release 8.3.4 * chore: format java code (ionic-team#8475) * chore: format java code (ionic-team#8477) * feat: add method getDouble to plugin config (ionic-team#7638) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * fix(SystemBars): make `safe-area-inset-x` available on API <= 34 (ionic-team#8424) * feat(cli): add experimental packageOptions (ionic-team#8471) * feat(cli): capture ios_package_manager in telemetry (ionic-team#8482) * fix(cli): revert live reload config on failure (ionic-team#8485) * chore: fix typo in declarations.ts (ionic-team#8488) * fix(SystemBars): respect `insetsHandling` disable (ionic-team#8481) * fix(android): show only the requested system bar (ionic-team#8480) Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: Pedro Bilro <pedro.gustavo.bilro@outsystems.com> Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> * chore: Decrease timeout for CI jobs from 60 to 30 minutes (ionic-team#8476) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * Release 8.4.0 * fix(cli): patch Capacitor SPM dependency version in plugins (ionic-team#8492) Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> * fix(cli): make SPM dependency patch work on prereleases (ionic-team#8508) * Release 8.4.1 * fix(core): make HttpResponse data type generic * fix(docs): update HttpResponse examples to use generic type * fix(core): make HttpResponse data type generic (cherry picked from commit 525c6f7) * fix(docs): update HttpResponse examples to use generic type (cherry picked from commit 462a05a) --------- Co-authored-by: Github Workflow (on behalf of markemer) <users.noreply.github.com> Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> Co-authored-by: Alex J. <alexandre.jacinto@outsystems.com> Co-authored-by: Robin Genz <mail@robingenz.dev> Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: Minh Vu <vuhoangminh97@gmail.com> Co-authored-by: Pedro Bilro <pedro.gustavo.bilro@outsystems.com> Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> Co-authored-by: Mohamed Ben Makhlouf <med.b.makhlouf@gmail.com> Co-authored-by: Capacitor+ Bot <bot@capgo.app> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
…ieStore observer so cookie sync works (#83) * Release 8.3.2 * fix(cli): copy plugin files in CocoaPods projects (ionic-team#8467) * Release 8.3.3 * chore(cli): update telemetry endpoint (ionic-team#8464) * Release 8.3.4 * chore: format java code (ionic-team#8475) * chore: format java code (ionic-team#8477) * feat: add method getDouble to plugin config (ionic-team#7638) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * fix(SystemBars): make `safe-area-inset-x` available on API <= 34 (ionic-team#8424) * feat(cli): add experimental packageOptions (ionic-team#8471) * feat(cli): capture ios_package_manager in telemetry (ionic-team#8482) * fix(cli): revert live reload config on failure (ionic-team#8485) * chore: fix typo in declarations.ts (ionic-team#8488) * fix(SystemBars): respect `insetsHandling` disable (ionic-team#8481) * fix(android): show only the requested system bar (ionic-team#8480) Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: Pedro Bilro <pedro.gustavo.bilro@outsystems.com> Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> * chore: Decrease timeout for CI jobs from 60 to 30 minutes (ionic-team#8476) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * Release 8.4.0 * fix(cli): patch Capacitor SPM dependency version in plugins (ionic-team#8492) Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> * fix(cli): make SPM dependency patch work on prereleases (ionic-team#8508) * Release 8.4.1 * chore: run `npm run fmt` to fix lint errors (ionic-team#8516) * fix(ios): retain WKHTTPCookieStore observer so cookie sync works * fix(ios): retain WKHTTPCookieStore observer so cookie sync works (cherry picked from commit 3fc41b8) --------- Co-authored-by: Github Workflow (on behalf of markemer) <users.noreply.github.com> Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> Co-authored-by: Alex J. <alexandre.jacinto@outsystems.com> Co-authored-by: Robin Genz <mail@robingenz.dev> Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: Minh Vu <vuhoangminh97@gmail.com> Co-authored-by: Pedro Bilro <pedro.gustavo.bilro@outsystems.com> Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> Co-authored-by: Mika Ruch <mika.ruch@zuehlke.com> Co-authored-by: Capacitor+ Bot <bot@capgo.app> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
… truncation (#71) * Release 8.3.2 * fix(cli): copy plugin files in CocoaPods projects (ionic-team#8467) * Release 8.3.3 * chore(cli): update telemetry endpoint (ionic-team#8464) * Release 8.3.4 * chore: format java code (ionic-team#8475) * chore: format java code (ionic-team#8477) * feat: add method getDouble to plugin config (ionic-team#7638) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * fix(SystemBars): make `safe-area-inset-x` available on API <= 34 (ionic-team#8424) * feat(cli): add experimental packageOptions (ionic-team#8471) * feat(cli): capture ios_package_manager in telemetry (ionic-team#8482) * fix(cli): revert live reload config on failure (ionic-team#8485) * chore: fix typo in declarations.ts (ionic-team#8488) * fix(android): range request truncation * fix(android): range request truncation (cherry picked from commit 6a9f325) --------- Co-authored-by: Github Workflow (on behalf of markemer) <users.noreply.github.com> Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> Co-authored-by: Alex J. <alexandre.jacinto@outsystems.com> Co-authored-by: Robin Genz <mail@robingenz.dev> Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: bwees <brandonwees@gmail.com> Co-authored-by: Capacitor+ Bot <bot@capgo.app> Co-authored-by: Cursor Agent <cursoragent@cursor.com>






Description
This PR makes the custom injected
safe-area-inset-xCSS variables available for Android devices on API <= 34, to make dealing with UI safe area logic more consistent across Android versions.Change Type
Rationale / Problems Fixed
fixes: #8394
Tests or Reproductions
Screenshots / Media
Platforms Affected
Notes / Comments