Skip to content

fix(android): propagate IME inset and force bottom inset on Android 1… - #643

Open
rencsikmarian wants to merge 1 commit into
Cap-go:mainfrom
rencsikmarian:fix/android15-safe-area-ime-and-force-inset
Open

fix(android): propagate IME inset and force bottom inset on Android 1…#643
rencsikmarian wants to merge 1 commit into
Cap-go:mainfrom
rencsikmarian:fix/android15-safe-area-ime-and-force-inset

Conversation

@rencsikmarian

@rencsikmarian rencsikmarian commented Jul 24, 2026

Copy link
Copy Markdown

…5 edge-to-edge

Follow-up to #642. Applies the keyboard (IME) inset to the SwipeRefreshLayout container padding (child margins are ignored there) and, on Android 15 edge-to-edge, insets the bottom system bar regardless of the enabledSafeBottomMargin opt-in. Refs #641.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved bottom safe-area handling by correctly separating “safe bottom” system insets from the keyboard (IME) inset.
    • Enhanced bottom padding behavior so Android 15 edge-to-edge layouts apply necessary navigation-bar spacing even when safe-area margins aren’t explicitly enabled.
    • Fixed/strengthened clamping behavior for negative or conflicting inset values to prevent incorrect padding.
  • Tests
    • Expanded coverage for container bottom padding and Android 15 forced edge-to-edge scenarios, including additional negative-inset cases.

@github-actions

Copy link
Copy Markdown
Contributor

Beta npm build

This PR comes from a fork, so beta publish is disabled for security.

If you need a beta package, move the branch into this repository first.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ef3cddb5-b061-407b-8f95-eccf2704dff6

📥 Commits

Reviewing files that changed from the base of the PR and between 79ba043 and 157c39f.

📒 Files selected for processing (3)
  • android/src/main/java/ee/forgr/capacitor_inappbrowser/SafeAreaInsetsSupport.java
  • android/src/main/java/ee/forgr/capacitor_inappbrowser/WebViewDialog.java
  • android/src/test/java/ee/forgr/capacitor_inappbrowser/SafeAreaInsetsSupportTest.java
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Cap-go/capacitor-updater (manual)

📝 Walkthrough

Walkthrough

The Android inset flow now combines safe-area and IME bottom insets, applies bottom insets for opted-in or forced edge-to-edge containers, and adds coverage for keyboard, clamping, and Android 15 behavior.

Changes

Android container insets

Layer / File(s) Summary
Bottom inset contract and application
android/src/main/java/ee/forgr/capacitor_inappbrowser/SafeAreaInsetsSupport.java, android/src/main/java/ee/forgr/capacitor_inappbrowser/WebViewDialog.java
Bottom padding combines safe-bottom and IME insets, while bottom insetting is enabled when safe margins or edge-to-edge mode is active.
Inset behavior tests
android/src/test/java/ee/forgr/capacitor_inappbrowser/SafeAreaInsetsSupportTest.java
Tests cover keyboard-aware padding, clamping, opt-in behavior, and forced edge-to-edge insets.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant WebViewDialog
  participant WindowInsetsCompat
  participant SafeAreaInsetsSupport
  participant WebViewContainer
  WebViewDialog->>WindowInsetsCompat: Read IME insets
  WebViewDialog->>SafeAreaInsetsSupport: Determine bottom inset policy
  SafeAreaInsetsSupport-->>WebViewDialog: Return applyBottomInset
  WebViewDialog->>SafeAreaInsetsSupport: Resolve safe bottom, IME, and app-bar padding
  SafeAreaInsetsSupport-->>WebViewDialog: Return container bottom padding
  WebViewDialog->>WebViewContainer: Apply bottom padding
Loading

Possibly related PRs

Suggested reviewers: riderx

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main Android inset changes: IME propagation and forced bottom insets on Android 15 edge-to-edge.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.44.1)
android/src/main/java/ee/forgr/capacitor_inappbrowser/WebViewDialog.java

ast-grep timed out on this file


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 3 files

Re-trigger cubic

…5 edge-to-edge

Follow-up to Cap-go#642. Applies the keyboard (IME) inset to the SwipeRefreshLayout container padding (child margins are ignored there) and, on Android 15 edge-to-edge, insets the bottom system bar regardless of the enabledSafeBottomMargin opt-in. Refs Cap-go#641.
@rencsikmarian
rencsikmarian force-pushed the fix/android15-safe-area-ime-and-force-inset branch from 79ba043 to 157c39f Compare July 25, 2026 09:28
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant