Skip to content

Instantly share code, notes, and snippets.

@FannyDemey
Created April 12, 2024 07:49
Show Gist options
  • Save FannyDemey/6873c6b28703edace225c7b557add574 to your computer and use it in GitHub Desktop.
Save FannyDemey/6873c6b28703edace225c7b557add574 to your computer and use it in GitHub Desktop.
PodcastsList
@Composable
private fun PodcastsList(
podcasts: List<Podcast>,
onFavouriteClicked: (id: String) -> Unit,
onPodcastClick: (id: String) -> Unit,
modifier: Modifier = Modifier,
) {
Box {
LazyColumn(
modifier = modifier,
verticalArrangement = Arrangement.spacedBy(8.dp),
) {
items(podcasts, key = { it.id }) { podcast ->
PodcastItem(
podcast = podcast,
onFavouriteClicked = { onFavouriteClicked(podcast.id) },
modifier = Modifier
.border(
1.dp,
MaterialTheme.colorScheme.tertiary,
MaterialTheme.shapes.medium,
)
.background(
color = MaterialTheme.colorScheme.background,
shape = MaterialTheme.shapes.medium,
).clickable {
onPodcastClick(podcast.id)
},
)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment