move imePadding to outer Box — fix input floating into chat area
The root cause: imePadding on the bottom dock Column inflated it by the full keyboard height, pushing it up into the chat content. Fix: imePadding on the outer Box that contains everything. Now the entire layout shrinks when keyboard opens — chat area gets shorter, dock stays at the (new) bottom edge. No overlap.
This commit is contained in:
parent
27deaca2e4
commit
77976ea974
1 changed files with 10 additions and 13 deletions
|
|
@ -535,7 +535,7 @@ fun ChatScreen(
|
|||
gesturesEnabled = true // Allows swiping from the screen's left edge to open the drawer
|
||||
) {
|
||||
MeshBackground {
|
||||
Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
|
||||
Box(Modifier.fillMaxSize().imePadding(), 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.
|
||||
|
|
@ -707,11 +707,10 @@ fun ChatScreen(
|
|||
Column(
|
||||
modifier = Modifier
|
||||
.align(Alignment.BottomCenter)
|
||||
.then(
|
||||
.background(
|
||||
if (imeVisible) {
|
||||
Modifier.background(scrimColor)
|
||||
Brush.verticalGradient(listOf(scrimColor, scrimColor))
|
||||
} else {
|
||||
Modifier.background(
|
||||
Brush.verticalGradient(
|
||||
colorStops = arrayOf(
|
||||
0f to Color.Transparent,
|
||||
|
|
@ -720,11 +719,9 @@ fun ChatScreen(
|
|||
1f to scrimColor,
|
||||
),
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
.navigationBarsPadding()
|
||||
.imePadding()
|
||||
.then(if (isTablet) Modifier.widthIn(max = 720.dp) else Modifier)
|
||||
) {
|
||||
if (!imeVisible) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue