Hitanshu Dhawan
12/18/2020, 5:13 PMLazyColumnFor
I’m using alpha08, and I can find methods like LazyListState.snapToItemIndex
but this is without smooth scrolling and the method LazyListState.smoothScrollBy
doesn’t take the index.
How to smooth scroll to a specific index? Does the API exists for this right now?Adam Powell
12/18/2020, 5:18 PM.scroll {}
api lets you take full control over smooth scrolling over timeHitanshu Dhawan
12/18/2020, 5:29 PM.scroll {}
API, and I’m not sure if I’m using it correctly.
There is only one method for ScrollScope
and that is fun scrollBy(pixels: Float): Float
So, I tried this piece of code
onClick = {
coroutineScope.launch {
state.scroll {
state.snapToItemIndex(15)
}
}
}
But there is not scrolling or snapping to the index in this case, am I doing something wrong here?Adam Powell
12/18/2020, 6:45 PMDominaezzz
12/18/2020, 7:24 PMsmoothScrollTo
available iirc.Marcin Środa
12/22/2020, 11:13 AMsnapToItemIndex
.