Skip to content

Instantly share code, notes, and snippets.

@MrNtlu
Created December 17, 2022 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrNtlu/0e9170fe4bdc3e67e36611cb0b47bf18 to your computer and use it in GitHub Desktop.
Save MrNtlu/0e9170fe4bdc3e67e36611cb0b47bf18 to your computer and use it in GitHub Desktop.
LazyColumn(state = lazyColumnListState) {
items(
items = articles,
key = { it.url },
) { article ->
Text(
modifier = Modifier
.height(75.dp),
text = article.title,
)
Divider()
}
item (
key = viewModel.listState,
) {
when(viewModel.listState) {
ListState.LOADING -> {
Loading()
}
ListState.PAGINATING -> {
PaginationLoading()
}
ListState.PAGINATION_EXHAUST -> {
PaginationExhaust()
}
else -> {}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment