Skip to content

fix(android-edge-to-edge-support): detect edge-to-edge at runtime instead of checking API level#832

Merged
robingenz merged 3 commits into
mainfrom
fix/android-edge-to-edge-top-inset-detection
Apr 13, 2026
Merged

fix(android-edge-to-edge-support): detect edge-to-edge at runtime instead of checking API level#832
robingenz merged 3 commits into
mainfrom
fix/android-edge-to-edge-top-inset-detection

Conversation

@robingenz
Copy link
Copy Markdown
Member

Summary

  • Replace the Build.VERSION.SDK_INT >= 35 check for applying the top margin with runtime detection of whether the system is already handling the top inset.
  • Check android.R.id.content padding to determine if decorFitsSystemWindows is true, which works across all API levels without reflection.
  • Fixes an issue where the WebView would render behind the status bar on Android < 15 when edge-to-edge was enabled by the app or emulator configuration.

Copilot AI review requested due to automatic review settings April 13, 2026 15:02
@robingenz robingenz self-assigned this Apr 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Android edge-to-edge support plugin to apply the WebView’s top inset based on runtime detection (whether the system is already handling the top inset) rather than relying on an Android 15+ API-level check, fixing status-bar overlap on older Android versions when edge-to-edge is enabled.

Changes:

  • Replace the SDK_INT >= 35 top-margin gating with a runtime heuristic based on android.R.id.content top padding.
  • Keep bottom/side inset application behavior the same while updating overlay layout call formatting.
  • Add a Changesets entry to publish a patch release of @capawesome/capacitor-android-edge-to-edge-support.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/android-edge-to-edge-support/android/src/main/java/io/capawesome/capacitorjs/plugins/androidedgetoedgesupport/EdgeToEdge.java Switch top-inset application from API-level gating to runtime detection via content view padding.
.changeset/fix-edge-to-edge-top-inset.md Patch changeset describing the runtime detection fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 13, 2026

Open in StackBlitz

@capawesome/capacitor-age-signals

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-age-signals@832

@capawesome-team/capacitor-android-battery-optimization

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome-team/capacitor-android-battery-optimization@832

@capawesome/capacitor-android-dark-mode-support

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-android-dark-mode-support@832

@capawesome/capacitor-android-edge-to-edge-support

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-android-edge-to-edge-support@832

@capawesome-team/capacitor-android-foreground-service

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome-team/capacitor-android-foreground-service@832

@capawesome/capacitor-app-review

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-app-review@832

@capawesome/capacitor-app-shortcuts

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-app-shortcuts@832

@capawesome/capacitor-app-update

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-app-update@832

@capawesome/capacitor-apple-sign-in

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-apple-sign-in@832

@capawesome/capacitor-asset-manager

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-asset-manager@832

@capawesome/capacitor-background-task

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-background-task@832

@capawesome/capacitor-badge

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-badge@832

@capawesome/capacitor-cloudinary

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-cloudinary@832

@capawesome-team/capacitor-datetime-picker

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome-team/capacitor-datetime-picker@832

@capawesome-team/capacitor-file-opener

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome-team/capacitor-file-opener@832

@capawesome/capacitor-file-picker

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-file-picker@832

@capawesome/capacitor-google-sign-in

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-google-sign-in@832

@capawesome/capacitor-libsql

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-libsql@832

@capawesome/capacitor-live-update

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-live-update@832

@capawesome/capacitor-managed-configurations

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-managed-configurations@832

@capawesome/capacitor-photo-editor

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-photo-editor@832

@capawesome/capacitor-pixlive

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-pixlive@832

@capawesome/capacitor-posthog

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-posthog@832

@capawesome/capacitor-realtimekit

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-realtimekit@832

@capawesome/capacitor-screen-orientation

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-screen-orientation@832

@capawesome/capacitor-screenshot

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-screenshot@832

@capawesome/capacitor-square-mobile-payments

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-square-mobile-payments@832

@capawesome/capacitor-superwall

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-superwall@832

@capawesome/capacitor-torch

npm i https://pkg.pr.new/capawesome-team/capacitor-plugins/@capawesome/capacitor-torch@832

commit: 9c16ebb

@robingenz robingenz merged commit 332479f into main Apr 13, 2026
6 checks passed
@robingenz robingenz deleted the fix/android-edge-to-edge-top-inset-detection branch April 13, 2026 15:20
@github-actions github-actions Bot mentioned this pull request Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants