Skip to content

Resize the WebView when the soft keyboard appears (closes #26)#57

Open
jim-daf wants to merge 1 commit intowwWallet:mainfrom
jim-daf:fix/keyboard-resize-issue-26
Open

Resize the WebView when the soft keyboard appears (closes #26)#57
jim-daf wants to merge 1 commit intowwWallet:mainfrom
jim-daf:fix/keyboard-resize-issue-26

Conversation

@jim-daf
Copy link
Copy Markdown

@jim-daf jim-daf commented Apr 23, 2026

Resize the WebView when the soft keyboard appears

Closes #26

What changed

wrapper/src/main/AndroidManifest.xml

Add android:windowSoftInputMode="adjustResize" to the MainActivity declaration. With this attribute the system shrinks the activity window when the soft keyboard opens, instead of panning it. The hosted WebView receives the new size, the page reflows, and the focused input stays visible above the keyboard.

Key snippet

<activity
    android:name=".MainActivity"
    android:configChanges="keyboard|keyboardHidden"
    android:exported="true"
    android:windowSoftInputMode="adjustResize"
    android:theme="@style/Theme.Wwwallet">

@jim-daf jim-daf marked this pull request as ready for review April 23, 2026 09:46
Copilot AI review requested due to automatic review settings April 23, 2026 09:46
Copy link
Copy Markdown

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

Updates the Android wrapper so the hosted WebView is intended to resize (instead of pan) when the soft keyboard opens, keeping focused inputs visible (closes #26).

Changes:

  • Add android:windowSoftInputMode="adjustResize" to MainActivity in the Android manifest.

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

android:name=".MainActivity"
android:configChanges="keyboard|keyboardHidden"
android:exported="true"
android:windowSoftInputMode="adjustResize"
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

Given the app’s minSdk is 33 and MainActivity calls enableEdgeToEdge() (which opts into edge-to-edge window insets handling), android:windowSoftInputMode="adjustResize" is often ineffective on modern Android when the window is not fitting system windows. This change may therefore not actually resize the Compose layout/WebView when the IME appears. Consider either disabling edge-to-edge for this activity (fit system windows) or handling IME insets in Compose (e.g., applying IME padding/insets to the Scaffold/content) so the WebView reliably shrinks above the keyboard on Android 13+.

Suggested change
android:windowSoftInputMode="adjustResize"
android:windowSoftInputMode="adjustPan"

Copilot uses AI. Check for mistakes.
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.

Resize webview when keyboard appears

2 participants