Skip to content

Instantly share code, notes, and snippets.

@andreasnilsson
Created July 22, 2025 23:27
Show Gist options
  • Select an option

  • Save andreasnilsson/397c0016207d57721b782bec7b60181e to your computer and use it in GitHub Desktop.

Select an option

Save andreasnilsson/397c0016207d57721b782bec7b60181e to your computer and use it in GitHub Desktop.
LookaheadScope {
Row(
modifier
.fillMaxWidth()
.padding(paddingValues),
horizontalArrangement = Arrangement.SpaceBetween
) {
tableau.forEachIndexed { i, stack ->
CardStack(
onDropped = { suit, value, dropSource ->
viewModel.onDropped(suit, value, CardLocation.decode(dropSource), TableauLocation(i))
},
) {
if (stack.isEmpty()) {
EmptyCard()
}
stack.forEach {
PlayingCard(
modifier = Modifier.animateBounds(this@LookaheadScope),
model = it.toUiModel(),
withShadow = true,
disabled = isPaused,
onDoubleClick = {
viewModel.onDoubleClickCard(it, TableauLocation(i))
},
onGetDropSource = { TableauLocation(i) },
)
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment