https://kotlinlang.org logo
Title
k

K Merle

05/22/2023, 6:15 PM
Is it possible to messure LazyColumn item height, that is no yet visible on screen?
y

Yves Kalume

05/22/2023, 6:41 PM
perhaps if the item is inside a BoxWithConstraints
k

K Merle

05/22/2023, 6:44 PM
Weird thing is, with dynamic height of the items
verticalScrollState.firstVisibleItemIndex
gives me correct index, however, getting an item from
verticalScrollState.layoutInfo.visibleItemsInfo
does give me wrong info about item height. So hard to adjust in LazyCompose
s

Sean Proctor

05/22/2023, 9:43 PM
If you need to measure components, I don't think you can use anything lazy.
If it's not on the screen, it's not being rendered, so whatever you're seeing for the size is the best approximation. I believe it's based on what actually is being shown.
I would try a normal
Column
and see if the performance is adequate.
e

efemoney

05/23/2023, 9:45 AM
Hmm, why would you want to do this? Whats your use case?