Last active
August 26, 2022 13:37
-
-
Save Skyyo/1336b308c0497c39a3a71d121e634d16 to your computer and use it in GitHub Desktop.
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 | |
fun CardsScreen(viewModel: CardsViewModel) { | |
val cards by viewModel.cards.collectAsStateWithLifecycle() | |
val expandedCardIds by viewModel.expandedCardIdsList.collectAsStateWithLifecycle() | |
Scaffold { | |
LazyColumn { | |
items(cards, ExpandableCardModel::id) { card -> | |
ExpandableCard( | |
card = card, | |
onCardArrowClick = { viewModel.onCardArrowClicked(card.id) }, | |
expanded = expandedCardIds.contains(card.id), | |
) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment