Seems like using paging compose `items` with `Lazy...
# compose
t
Seems like using paging compose
items
with
LazyColumn
does not restore the scroll position when navigate back using navigation compose. Does anyone have the same issue?
a
I was facing the same with compose alpha06 , will try upgrading my projects later and check if anything has changed
t
I'm using compose alpha07 and both navigation and paging is alpha02.
j
If you hoist your scroll state up, you can manually restore/retain the scroll position.
t
Still not able to restore the scroll position even manually save the
firstVisibleItemIndex
into shared preferences and restore by
initialFirstVisibleItemIndex
.
And I notice that
collectAsLazyPagingItems
will return different instance eveytime I navigate back.
I'm using a workaround not compose
LazyColumn
when
LazyPagingItems<T>.itemCount == 0
, and the scroll position is restored right now
m
Could you share how are you doing that? It seems like this is still a problem