Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ plugins {

android {
namespace = "at.dasher.android"
compileSdk = 35
compileSdk = 36
ndkVersion = "27.0.12077973"

defaultConfig {
applicationId = "at.dasher.android"
minSdk = 24
targetSdk = 35
targetSdk = 36
versionCode = gitVersionCode(base = 1000, fallback = 8)
versionName = gitVersionName(fallback = "0.1.8")

Expand Down
22 changes: 21 additions & 1 deletion app/src/main/java/at/dasher/android/DasherImeService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ class DasherImeService : InputMethodService() {
// window's FrameLayout-based decor. LinearLayout.LayoutParams here
// survives until a re-measure casts them and crashes (Float's
// docked-shrink relayout did exactly that).
dockedRoot = root
setDockedHeight(imeHeightPx())
root.minimumHeight = imeHeightPx()
dockedRoot = root

floatBtn.setOnClickListener { enterFloatingMode(floatBtn) }

Expand Down Expand Up @@ -469,6 +469,26 @@ class DasherImeService : InputMethodService() {
eng.clearSpeakListener() // IME doesn't speak (the app does)
}

// API 36+ (Android 16): measure the actual docked-root position in the
// window so the insets animation has a concrete target (review C1/C3:
// imeHeightPx() is a HEIGHT, not an offset — a constant created a dead
// touch band above the keyboard and was wrong in floating mode).
// Measuring handles both modes automatically: floating shrinks the
// docked root to 40dp, and the measurement reflects that.
// API 36+: force-show even if a hardware keyboard is attached — our users
// (motor-impaired AAC) always want the soft keyboard (accessibility decision).
override fun onEvaluateInputViewShown(): Boolean = true

override fun onComputeInsets(outInsets: Insets) {
super.onComputeInsets(outInsets)
val root = dockedRoot ?: return
val loc = IntArray(2)
root.getLocationInWindow(loc)
outInsets.contentTopInsets = loc[1]
outInsets.visibleTopInsets = loc[1]
outInsets.touchableInsets = Insets.TOUCHABLE_INSETS_CONTENT
}

override fun onStartInputView(info: EditorInfo?, restarting: Boolean) {
super.onStartInputView(info, restarting)
// Re-assert ALL IME-owned static listeners — the main app may have
Expand Down
Loading