Last active
August 22, 2021 18:50
-
-
Save Ahmed-Sellami/15a855ef2149290a04ddeed8767f40b2 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
@ExperimentalAnimationApi | |
@Composable | |
fun Home() { | |
val colorsArray = arrayOf(Purple, Blue, Red) | |
var particleColor by remember { mutableStateOf(Color.White) } | |
/* ... */ | |
Scaffold( | |
topBar = { | |
Box { | |
Particle( | |
modifier = Modifier | |
.align(Alignment.BottomCenter), | |
color = particleColor | |
) | |
TopAppBar( | |
/* ... */ | |
actions = { | |
IconButton(onClick = { | |
particleColor = colorsArray.random() | |
}) { | |
Icon(Icons.Filled.AddCircle, contentDescription = null) | |
} | |
}, | |
/* ... */ | |
) | |
} | |
} | |
) { /* ... */ } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment