Issue
There is something similar like swiperefreshlayout to pull to refresh in the jetpack compose
Solution
You can use Google's Accompanist library for implementing swipe-to-refresh.
Sample usage:
val viewModel: MyViewModel = viewModel()
val isRefreshing by viewModel.isRefreshing.collectAsState()
SwipeRefresh(
state = rememberSwipeRefreshState(isRefreshing),
onRefresh = { viewModel.refresh() },
) {
LazyColumn {
items(30) { index ->
// TODO: list items
}
}
}
Documentation: https://google.github.io/accompanist/swiperefresh/
Answered By - Saurabh Thorat
Answer Checked By - Timothy Miller (JavaFixing Admin)