Created
April 10, 2024 10:01
-
-
Save AndreVero/1e7ae27148ac989c35daa09d024b0c82 to your computer and use it in GitHub Desktop.
Change color of a picked item
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 currentItem by remember { | |
mutableStateOf(times.first()) | |
} | |
content = { item -> | |
val colorAnimation by animateColorAsState( | |
targetValue = if (item == currentItem) CircleAccentColor else CircleBackgroundColor, | |
animationSpec = spring( | |
dampingRatio = Spring.DampingRatioNoBouncy, | |
stiffness = Spring.StiffnessLow, | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment