i have compose screen where i collect list like this:
val list = viewModel.getSomeFlow().collectAsLazyPagingItems()
then i have swipe refresh layout with two params:
isRefreshing = list.loadState.refresh is LoadState.Loading
onRefresh = list::refresh
the problem i faced is that when i open this screen loader is visible, i debbuged and found out that there is moment when list have some values (4) but loading state is still Loading, i guess this is because amount of items is small, because if i change flow to one with more values (like 20) its woring correctly and loader is not visible, how can i fix it for small amount of values?
i tried changing isRefreshing to
isRefreshing = list.loadState.refresh is LoadState.Loading && !list.loadState.append.endOfPaginationReached,
but there were no effect
Mihail Lovchitskiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.