From 420bcd7cb637859f200c9f8d4baeb582cb5909c5 Mon Sep 17 00:00:00 2001 From: Bruno Deanoz Date: Mon, 22 Jun 2026 01:17:59 +0200 Subject: [PATCH] =?UTF-8?q?fix=20input=20field=20way=20too=20high=20?= =?UTF-8?q?=E2=80=94=20use=20adjustResize=20instead=20of=20imePadding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit imePadding() on Compose Box/Column with overlapping children (BottomCenter-aligned dock over fillMaxSize LazyColumn) caused the input to float to the top of the screen. The Compose inset system doesn't work well with this overlay layout pattern. Fix: remove all imePadding() usage, set windowSoftInputMode= adjustResize in AndroidManifest. Android resizes the window itself when the keyboard opens — the entire layout naturally reflows, dock stays at the bottom, chat area shrinks. This is the standard approach for chat apps with edge-to-edge. --- app/src/main/AndroidManifest.xml | 1 + app/src/main/java/dev/kaizen/app/chat/ChatScreen.kt | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3b944ea..0011128 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -21,6 +21,7 @@ android:name=".MainActivity" android:exported="true" android:label="@string/app_name" + android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.Kaizen"> diff --git a/app/src/main/java/dev/kaizen/app/chat/ChatScreen.kt b/app/src/main/java/dev/kaizen/app/chat/ChatScreen.kt index 71d8b1d..514f6fc 100644 --- a/app/src/main/java/dev/kaizen/app/chat/ChatScreen.kt +++ b/app/src/main/java/dev/kaizen/app/chat/ChatScreen.kt @@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.ExperimentalLayoutApi import androidx.compose.foundation.layout.WindowInsets -import androidx.compose.foundation.layout.imePadding import androidx.compose.foundation.layout.isImeVisible import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding @@ -538,7 +537,7 @@ fun ChatScreen( gesturesEnabled = true // Allows swiping from the screen's left edge to open the drawer ) { MeshBackground { - Box(Modifier.fillMaxSize().imePadding(), contentAlignment = Alignment.Center) { + Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { // 1. Scrollable Chat Content // Stretches to the full screen, allowing bubbles to scroll cleanly behind the floating bottom dock. // Centered layout with responsive width capping on tablets.