Skip to content

Instantly share code, notes, and snippets.

View Dambakk's full-sized avatar

Christopher Dambakk Dambakk

View GitHub Profile
@Dambakk
Dambakk / BallGrid.kt
Created March 4, 2021 08:00
Ball grid animation
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun AnimatedBallGrid(
numBalls: Int = 32,
numBallsPrRow: Int = 7,
) {
// viewModel contains an observable list of balls
val viewModel: BallsViewModel by remember { mutableStateOf(BallsViewModel(numBalls)) } // TODO: Use injection instead
var animationSpeed: AnimationSpeed by remember { mutableStateOf(AnimationSpeed.Fast) }