Adil
06/20/2024, 2:17 PMRok Oblak
06/20/2024, 2:59 PMchrisjenx
06/20/2024, 3:17 PMAdil
06/20/2024, 3:38 PMhafiz
07/25/2024, 4:59 AMRok Oblak
07/25/2024, 5:48 AMLazyListState
(example). You can map it a bit to receive the right result, i.e. the position of last visible item.
2. With this position, you can then notify your view model and repository about it. The repository uses this information to decide if a new page should be fetched (it knows what the last loaded item position is, so it knows if you scrolled near the end). Nothing complicated there, just basically making sure to debounce the new page load requests, to check that if a page is being loaded you ignore the request, etc.
3. Then all the usual - repo knows how to load the next page, the next page load appends to the list of loaded items, and your composable receives the new list.Adil
07/25/2024, 10:41 AMhafiz
07/26/2024, 1:33 AMhafiz
08/20/2024, 2:44 AMif (!viewModel.hasHandleScroll.value) {
if (viewModel.monitoredSpaceList.value.size + 10 < viewModel.total) {
viewModel.startLoadingMore()
viewModel.setEvent(MonitoredSpacesTabContract.Event.OnLoadMore)
isLoading = true
} else {
viewModel.stopLoadingMore()
isLoading = false
}
viewModel.hasHandleScroll(true)
}
}
}Adil
08/20/2024, 5:35 AMhafiz
08/20/2024, 7:28 AMviewModel.hasHandleScroll
hafiz
08/20/2024, 9:52 AMAdil
08/20/2024, 10:15 AM