Closed joreilly closed 2 years ago
Hi, @joreilly Yes. The JetLimeView already takes a LazyListState
!
So you hold a LazyListState and pass it:
val listState = rememberLazyListState()
JetLimeView(
jetLimeItemsModel = jetLimeItemsModel,
jetLimeViewConfig = jetTimeLineViewConfig,
listState = listState
)
And then:
listState.scrollToItem(index = 4)
This will scroll to the 4th item of the list.
In sample AnimatedTimeLine
, I have shown how to use the list state to always keep the list scrolled till the bottom, by using:
listState.scrollToItem(jetLimeItemsModel.items.size)
Hope this will help you to scroll to the particular bus stop item! 😃
nice, thanks!
Is there any way right now to be able to scroll to particular JetLimeItem in the list? I'm using for bus stops on particular route and ideally would like, as data is updated, to scroll to JetLimeItem for the next stop a bus is due to arrive at.