What's the best way to know the scroll direction of a LazyColumn?
I'm currently using a LazyListState, and by keeping a reference of the last value of
firstVisibleItemScrollOffset
from LazyListState, I can compare it to the current value so if
lastOffset
is lower than
firstVisibleItemScrollOffset
, that means the user is scrolling down, however if
lastOffset
is higher than
firstVisibleItemScrollOffset
, that means the user is scrolling up. At least that's the result I was hoping for but unfortunately
firstVisibleItemScrollOffset
is often equal to
lastOffset
.
So what is the best way to know the scroll direction of a LazyColumn? 🤔
(What I would like to achieve is similar to what we used to do with the XML Toolbar View using app:layout_scrollFlags)