fix(键盘): 统一修复 Android 软键盘遮挡输入框
Docker Build and Push / build-image (push) Successful in 3m52s

根因: Tauri targetSdk 37 强制 edge-to-edge, MainActivity 不处理 IME Insets,
系统不再因键盘缩小窗口, 清单 adjustResize 失效, 键盘直接盖住 WebView。

- 新增 scripts/ci/android-softinput.sh: init 后注入 windowSoftInputMode=adjustResize,
  并重写 MainActivity.kt 监听 IME Insets, 键盘可见时把高度加到内容容器底部 (API 30+),
  让 WebView 真正变矮, 所有 bottom 弹层自动上移
- CI (android-build.yml) 与本地 build-apk.sh 在 init 之后、build 之前调用该脚本 (幂等)
- 新增全局 useKeepInputVisible: 输入框聚焦后用 scroll-into-view-if-needed 滚入可视区,
  覆盖页面滚动与 Popup 内部滚动
- 弹层补 max-height + 内部滚动, 防止键盘弹出后顶部被顶出屏幕
- calibrateSafeTop 在键盘弹出时保留旧值, 避免误判导致整页跳动
This commit is contained in:
jif2.zhang
2026-11-09 16:25:11 +08:00
parent 3730e55e93
commit 7b52220aad
9 changed files with 218 additions and 0 deletions
+1
View File
@@ -54,6 +54,7 @@
"react-dom": "^18.2.0",
"react-router-dom": "^6.26.0",
"recharts": "^3.8.1",
"scroll-into-view-if-needed": "^3.1.0",
"swiper": "^14.4.0",
"tauri-plugin-hotswap-api": "^0.0.4",
"ws": "^8.21.2",