Open mykola-dev opened 2 years ago
i actually fixed it by implementing own state facade. internally it works with the LazyListState states collection. so for example if I need to scroll to item 100 in 2 columns grid, I just scroll each column by 100/2 items.
for the first visible item I do
val firstVisibleItemIndex: Int get() = states.map { it.firstVisibleItemIndex }.fold(0) { acc, i -> acc + i }
the code isn't ready for a PR, so can't share right now. I'll push it when have some time.
LazyListState doesn't provide valid info. also its behavior is wrong. For example
firstVisibleItemIndex
provides the index only for left column. alsostate.scrollToItem()
doesn't work as expected. it scrolls to much.