I have a bottom sheet used for search, and it has two UI states. Both states share the same LazyColumn.
State 1:
LazyColumn {
item { Row { ... } } // search categories
item { Text(text = "Empty history") }
}
State 2:
LazyColumn {
item { Text(text = "Results") }
items(results) { result ->
ResultCard(result)
}
}
The problem is that in State 1 I need the "Empty history" text to stay visible between the first 'item { Row() }' and the keyboard, without adding extra scrolling behavior.
Using 'Modifier.fillParentMaxHeight(weight).imePadding()' on the 'Text()' introduces unwanted extra scroll, which I’d like to avoid.
Switching from LazyColumn to Column for State 1 is not an option because I want to keep both states structurally consistent.That causes a lot of other problems in the app.
The layout needs to remain adaptive, because on smaller devices the keyboard almost covers the "Empty history" text even when the content is aligned to the top.
How can I keep using a LazyColumn while ensuring that "Empty history" stays visible above the keyboard without introducing additional scroll distance?
bringIntoViewRequester?