Skip to content

Instantly share code, notes, and snippets.

@Ahmed-Sellami
Created Aug 24, 2021
Embed
What would you like to do?
/* ... */
var isFired by remember { mutableStateOf(false) }
val shoesArticles = remember { mutableStateListOf<ShoesArticle>() }
var addedArticle by remember { mutableStateOf(ShoesArticle()) }
var id by remember { mutableStateOf(0) }
Scaffold(
topBar = {
Box {
/* ... */
TopAppBar(
title = {
Text(text = "List Animations In Compose")
},
actions = {
IconButton(onClick = {
particleColor = colorsArray.random()
addedArticle =
allShoesArticles.first { it.color == particleColor }.copy(id = id)
.also {
id++
}
shoesArticles.add(0, addedArticle)
isFired = true
}) {
Icon(Icons.Filled.AddCircle, contentDescription = null)
}
},
/* ... */
)
}
}
) { /* ... */ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment