Resize the WebView when the soft keyboard appears (closes #26)#57
Resize the WebView when the soft keyboard appears (closes #26)#57jim-daf wants to merge 1 commit intowwWallet:mainfrom
Conversation
There was a problem hiding this comment.
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"toMainActivityin 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" |
There was a problem hiding this comment.
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+.
| android:windowSoftInputMode="adjustResize" | |
| android:windowSoftInputMode="adjustPan" |
Resize the WebView when the soft keyboard appears
Closes #26
What changed
wrapper/src/main/AndroidManifest.xmlAdd
android:windowSoftInputMode="adjustResize"to theMainActivitydeclaration. 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