I'm using Jetpack Compose version 1.0.2 (latest stable as of today).
I have a Column of multiple LazyRows, which has an Image and two Text.
See the structure below (simplified)
val topicList: List<Topics>
Column {
topicList.forEach { topic ->
val showList: List<Show> = topic.shows
Column {
Text(text = topic.title)
LazyRow {
items(showList) { show ->
Column {
Image()
Text(text = show.title)
Text(text = show.info)
}
}
}
Spacer(Modifier.height(32.dp))
}
}
}
The problem is the Text composables with show.title and show.info can be multiple lines, and as each item is lazy loaded, the height is not calculated until it shows up on the screen. As a result, the next row's y position jumps around.
To understand what's going on, please see this video: Video link
How can I dynamically calculate the Spacer's height so that they are not jumping? I know the easy solution would be just giving a fixed height, but some texts are just one liner and those will have bigger gaps so it's not really ideal for me I think.

