fix(android-edge-to-edge-support): detect edge-to-edge at runtime instead of checking API level#832
Merged
Conversation
…tead of checking API level
Contributor
There was a problem hiding this comment.
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 >= 35top-margin gating with a runtime heuristic based onandroid.R.id.contenttop 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.
@capawesome/capacitor-age-signals
@capawesome-team/capacitor-android-battery-optimization
@capawesome/capacitor-android-dark-mode-support
@capawesome/capacitor-android-edge-to-edge-support
@capawesome-team/capacitor-android-foreground-service
@capawesome/capacitor-app-review
@capawesome/capacitor-app-shortcuts
@capawesome/capacitor-app-update
@capawesome/capacitor-apple-sign-in
@capawesome/capacitor-asset-manager
@capawesome/capacitor-background-task
@capawesome/capacitor-badge
@capawesome/capacitor-cloudinary
@capawesome-team/capacitor-datetime-picker
@capawesome-team/capacitor-file-opener
@capawesome/capacitor-file-picker
@capawesome/capacitor-google-sign-in
@capawesome/capacitor-libsql
@capawesome/capacitor-live-update
@capawesome/capacitor-managed-configurations
@capawesome/capacitor-photo-editor
@capawesome/capacitor-pixlive
@capawesome/capacitor-posthog
@capawesome/capacitor-realtimekit
@capawesome/capacitor-screen-orientation
@capawesome/capacitor-screenshot
@capawesome/capacitor-square-mobile-payments
@capawesome/capacitor-superwall
@capawesome/capacitor-torch
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Build.VERSION.SDK_INT >= 35check for applying the top margin with runtime detection of whether the system is already handling the top inset.android.R.id.contentpadding to determine ifdecorFitsSystemWindowsis true, which works across all API levels without reflection.