Keep the number box from eating volume keys or changing subtitles on close
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 1m43s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 1m19s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-11-01 23:05:06 +00:00
co-authored by Claude Opus 5.5
parent 18967e1531
commit 51fe5e1e9e
@@ -177,7 +177,8 @@ internal fun EmbyPlaybackDialog(session: EmbySampleSession, plan: EmbyPlaybackPl
return@setOnKeyListener true
}
numberEntry?.let { entry ->
val advance = isOk && event.action == KeyEvent.ACTION_UP || code == KeyEvent.KEYCODE_DPAD_RIGHT && event.action == KeyEvent.ACTION_DOWN
// On release, so the key that closes the box can't also act on the channel behind it.
val advance = (isOk || code == KeyEvent.KEYCODE_DPAD_RIGHT) && event.action == KeyEvent.ACTION_UP
if (advance) { if (entry.onLastSlot) submitNumber(entry) else numberEntry = entry.next() }
else if (event.action == KeyEvent.ACTION_DOWN) {
numberProblem = null
@@ -188,7 +189,7 @@ internal fun EmbyPlaybackDialog(session: EmbySampleSession, plan: EmbyPlaybackPl
typedDigit != null -> if (entry.onLastSlot) entry.type(typedDigit).let { numberEntry = it; submitNumber(it) } else numberEntry = entry.type(typedDigit)
}
}
return@setOnKeyListener code != KeyEvent.KEYCODE_BACK
return@setOnKeyListener isOk || typedDigit != null || code in listOf(KeyEvent.KEYCODE_DPAD_UP, KeyEvent.KEYCODE_DPAD_DOWN, KeyEvent.KEYCODE_DPAD_LEFT, KeyEvent.KEYCODE_DPAD_RIGHT)
}
val supported = code in listOf(KeyEvent.KEYCODE_DPAD_CENTER, KeyEvent.KEYCODE_ENTER,
KeyEvent.KEYCODE_DPAD_LEFT, KeyEvent.KEYCODE_DPAD_RIGHT, KeyEvent.KEYCODE_DPAD_UP, KeyEvent.KEYCODE_DPAD_DOWN,