Skip to content

Instantly share code, notes, and snippets.

@Ahmed-Sellami
Last active August 22, 2021 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ahmed-Sellami/15a855ef2149290a04ddeed8767f40b2 to your computer and use it in GitHub Desktop.
Save Ahmed-Sellami/15a855ef2149290a04ddeed8767f40b2 to your computer and use it in GitHub Desktop.
@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