@Composable
fun ChatScreenContent(
modifier: Modifier = Modifier,
// ...
) {
// ...
Column(
modifier = modifier.fillMaxSize(),
) {
LazyColumn(
modifier = Modifier.weight(1f),
contentPadding = PaddingValues(vertical = 8.dp),
state = scrollState,
) {
// ...
}
MessageInput(
modifier = Modifier.padding(horizontal = 4.dp).imePadding(),
// ...
)
Spacer(modifier = Modifier.height(8.dp))
}
}
When I use ‘android:windowSoftInputMode=”adjustResize”` and ‘imePadding()’ with MessageInput, when you open the keyboard, messages that were visible before are hidden.
I tried using ‘ android:windowSoftInputMode=”adjustPan” ‘and removed’ imePadding()` from MessageInput. Now the keyboard doesn’t close the last visible message, but the list of messages goes off-screen and I can’t scroll to the first message.
I would like that when the keyboard is opened, the last message is displayed on the screen, and the scroll position remains unchanged. As it was when using ‘android:windowSoftInputMode= “adjustPan”`. At the same time, so that the content does not go beyond the screen and all previous messages are visible.