Skip to content

Instantly share code, notes, and snippets.

@Skyyo
Last active August 30, 2022 08:27
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 Skyyo/591f9aaf6c8afd7c2de33ec4a84a0c44 to your computer and use it in GitHub Desktop.
Save Skyyo/591f9aaf6c8afd7c2de33ec4a84a0c44 to your computer and use it in GitHub Desktop.
@Composable
fun PodcastsScreen(viewModel: PodcastsViewModel) {
val podcasts by viewModel.podcasts.collectAsStateWithLifecycle()
LazyColumn {
itemsIndexed(podcasts, { _, item -> item.id }) { index, podcast ->
PodcastCard(
podcast = podcast,
onDownloadClick = { viewModel.onDownloadPodcastClicked(podcast.id, index) })
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment