Created
April 12, 2024 07:49
-
-
Save FannyDemey/6873c6b28703edace225c7b557add574 to your computer and use it in GitHub Desktop.
PodcastsList
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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