Is there any way to obtain the scroll position in ...
# compose
f
Is there any way to obtain the scroll position in pixels for a LazyListState?
🚫 1
a
No, not an absolute position from the beginning of the data set. Obtaining such a thing would require composing and measuring items for the full data set from the beginning, defeating the point of using a lazy container
f
Makes sense, thanks!
Was able to get a solution working for this using
firstVisibleItemIndex
,
firstVisibleItemScrollOffset
, and keeping track of the
LayoutCoordinates
of each item in a map using
onGloballyPositioned
. It's not elegant but it works. Thanks @Francesc for the suggestion