fix: resolve double-padding on chat screen when keyboard is opened

This commit is contained in:
Hy4ri
2026-06-16 00:34:45 +03:00
parent 48bf0a1ffc
commit 69f36b1606
2 changed files with 84 additions and 80 deletions
+1 -1
View File
@@ -11,10 +11,10 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.HermesControl">
<activity
android:name=".MainActivity"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -256,25 +256,20 @@ fun ChatScreen(
)
}
},
bottomBar = {
ChatInputBar(
inputText = inputText,
onInputChange = { inputText = it },
onSend = {
viewModel.sendMessage(inputText)
inputText = ""
},
onInterrupt = viewModel::interruptSession,
isAgentTyping = state.isAgentTyping,
isConnected = state.isConnected,
)
},
) { paddingValues ->
Box(
Column(
modifier =
Modifier
.fillMaxSize()
.padding(paddingValues),
.padding(paddingValues)
.navigationBarsPadding()
.imePadding(),
) {
Box(
modifier =
Modifier
.weight(1f)
.fillMaxWidth(),
) {
if (state.messages.isEmpty() && !state.isLoading) {
// Empty state
@@ -305,7 +300,7 @@ fun ChatScreen(
}
// Loading overlay
AnimatedVisibility(
androidx.compose.animation.AnimatedVisibility(
visible = state.isLoading,
enter = fadeIn(),
exit = fadeOut(),
@@ -342,6 +337,19 @@ fun ChatScreen(
}
}
}
ChatInputBar(
inputText = inputText,
onInputChange = { inputText = it },
onSend = {
viewModel.sendMessage(inputText)
inputText = ""
},
onInterrupt = viewModel::interruptSession,
isAgentTyping = state.isAgentTyping,
isConnected = state.isConnected,
)
}
}
}
@@ -452,11 +460,7 @@ private fun ChatInputBar(
exit = slideOutVertically(targetOffsetY = { it }),
) {
Card(
modifier =
Modifier
.fillMaxWidth()
.navigationBarsPadding()
.imePadding(),
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(topStart = 16.dp, topEnd = 16.dp),
colors =
CardDefaults.cardColors(