https://kotlinlang.org logo
#compose
Title
# compose
h

harry248

11/09/2020, 9:55 AM
I would like to mimic the liftOnScroll capability of AppBarLayout and therefore have to observe the scroll offset of a LazyColumn. Unfortunately I can’t find a way to do so. Is this something missing at the moment?
s

subashz

11/09/2020, 10:21 AM
I had played around with lazylist state. Here's my code if that's interest you: https://github.com/subashz/ComposeCookBook/blob/fa9c2a55271899925dd2978d24c681a26597e9f4/app/src/main/java/com/guru/composecookbook/ui/demoui/gmail/home/GmailHome.kt#L119. I think you can use firstVisibleItemIndex & firstVisibleItemScrollOffset, to achieve that result.
👍 1
h

harry248

11/09/2020, 10:43 AM
Thanks! Exactly what I was looking for!
16 Views