Fix landscape floating keyboard going offscreen on the right

This commit is contained in:
Aleksandras Kostarevas 2024-09-27 18:50:47 +03:00
parent 1c9c94b83d
commit 28f3c07d5f
2 changed files with 2 additions and 1 deletions

View File

@ -490,6 +490,7 @@ class LatinIME : InputMethodServiceCompose(), LatinIMELegacy.SuggestionStripCont
fun getInputViewHeight(): Int = inputViewHeight
fun getViewHeight(): Int = composeView?.height ?: resources.displayMetrics.heightPixels
fun getViewWidth(): Int = composeView?.width ?: resources.displayMetrics.widthPixels
private var isInputModal = false
fun setInputModal(to: Boolean) {

View File

@ -709,7 +709,7 @@ class UixManager(private val latinIME: LatinIME) {
newOffset.y.coerceAtLeast(0.0f)
)
newOffset = newOffset.copy(
newOffset.x.coerceAtMost(configuration.screenWidthDp.dp.toPx() - size.width),
newOffset.x.coerceAtMost(latinIME.getViewWidth().toFloat() - size.width),
newOffset.y.coerceAtMost(latinIME.getViewHeight().toFloat() - measuredTouchableHeight)
)