Last active
August 26, 2022 13:54
-
-
Save Skyyo/5457b36f0cd997adf26923ff8bc340d4 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
@ExperimentalCoroutinesApi | |
@Composable | |
fun CardsScreen(viewModel: CardsScreenViewModel) { | |
val cards by viewModel.cards.collectAsStateWithLifecycle() | |
val revealedCardIds by viewModel.revealedCardIdsList.collectAsStateWithLifecycle() | |
Scaffold { | |
LazyColumn { | |
items(cards.value, CardModel::id) { card -> | |
Box(Modifier.fillMaxWidth()) { | |
ActionsRow( | |
actionIconSize = ACTION_ITEM_SIZE.dp, | |
onDelete = {}, | |
onEdit = {}, | |
onFavorite = {} | |
) | |
DraggableCard( | |
card = card, | |
isRevealed = revealedCardIds.contains(card.id), | |
cardHeight = CARD_HEIGHT.dp, | |
cardOffset = CARD_OFFSET.dp(), | |
onExpand = { viewModel.onItemExpanded(card.id) }, | |
onCollapse = { viewModel.onItemCollapsed(card.id) }, | |
) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment