Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created Aug 12, 2022
Embed
What would you like to do?
performance_example
@Composable
fun ConcertPerformers(
scrollState: ScrollState,
venueName: String,
performers: PersistentList<String>,
modifier: Modifier = Modifier
) {
Column(modifier = modifier) {
Text(
modifier = Modifier.background(color = Color.LightGray),
text = "The following performers are performing at $venueName tonight:"
)
Column(
Modifier
.weight(1f)
.verticalScroll(scrollState)
) {
for (item in performers) {
PerformerItem(performer = item)
}
}
}
}
@Composable
fun PerformerItem(performer: String) {
Card(
modifier = Modifier
.padding(vertical = 10.dp)
.background(
color = Color.LightGray,
)
.wrapContentHeight()
.fillMaxWidth()
) {
Text(
modifier = Modifier.padding(10.dp),
text = performer
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment