Skip to content

fix(ime): targetSdk 36 + explicit insets — Android 16+ IME show failure (#59) - #60

Merged
willwade merged 1 commit into
mainfrom
fix/ime-api36-window
Sep 18, 2026
Merged

willwade merged 1 commit into
mainfrom
fix/ime-api36-window

Conversation

@willwade

Copy link
Copy Markdown
Contributor

Fixes #59 — Heide's Samsung Android 16 report: IME doesn't show in dock or float mode. Root cause: targetSdk = 35 triggers compatibility restrictions on Android 16+ that prevent the insets animation from completing. Even a plain View returned from onCreateInputView failed to show. Bumping to targetSdk 36 + adding explicit insets overrides fixes it. DCO signed.

#59)

ROOT CAUSE: targetSdk = 35. On Android 16+ (API 36+), apps targeting
below 36 get compatibility restrictions that prevent the IME insets
animation from completing (PHASE_IME_ON_SHOW_SOFT_INPUT_TRUE) —
onStartInputView never fires, the keyboard never renders. Verified:
even a plain green View failed to show.

Fix:
- targetSdk + compileSdk = 36: opts in to API 36 behavior
- onComputeInsets: MEASURED from the docked root's actual position
  (review C1/C3: imeHeightPx() is a height not an offset — the
  constant created a dead touch band and was wrong in floating mode;
  getLocationInWindow handles both modes correctly)
- onEvaluateInputViewShown = true: accessibility decision — our
  motor-impaired users always want the soft keyboard, even with a
  hardware keyboard attached (review I2: kept with honest comment)
- dockedRoot ordering: assigned BEFORE setDockedHeight (review C2:
  the original claim was correct but wasn't in the diff)

Signed-off-by: will wade <willwade@gmail.com>
@willwade
willwade force-pushed the fix/ime-api36-window branch from b89611f to ce1add6 Compare September 18, 2026 06:07
@willwade
willwade merged commit e85d9d0 into main Sep 18, 2026
2 checks passed
willwade added a commit that referenced this pull request Sep 18, 2026
## What

Persists the last-used dock/float mode (SharedPreferences,
`dasher_ime/start_mode`) and restores it after engine creation on the
next keyboard show. Docked stays the default.

## Why

Heide's v0.1.20 feedback: she wants the keyboard to "start directly as
docked, like other keyboards do" — on v0.1.16/Android 16 she had to tap
Float then Dock to get a working keyboard (that initial-show bug is
already fixed by #60's targetSdk 36; this PR makes the *preference*
stick regardless).

## Guards

- Floating restore only runs when `canDrawOverlays` is already granted —
never bounces the user to system settings on open
- A failed float (addView exception fallback path) does not persist
`floating`
- Button wiring moved to a `floatDockBtn` field (was a local passed as a
parameter); nulled in onDestroy

## Test plan

- [ ] Fresh install: keyboard opens docked
- [ ] Float → hide → reopen: opens floating
- [ ] Dock → hide → reopen: opens docked
- [ ] Without overlay permission + saved floating: opens docked, no
settings bounce
- [ ] `./gradlew :app:compileDebugKotlin :app:lintDebug` clean (verified
locally)

Refs #61 #63 (same feedback email).

Signed-off-by: will wade <willwade@gmail.com>
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.

Canvas letters offset behind cursor on Android 16 Samsung (regression) + IME starts in neither dock nor float mode

1 participant