-
-
Save Ahmed-Sellami/c07811273bb7369859d0835eb665dab2 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
/* ... */ | |
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