Skip to content

Instantly share code, notes, and snippets.

@AndreVero
Created April 10, 2024 10:01
Show Gist options
  • Save AndreVero/1e7ae27148ac989c35daa09d024b0c82 to your computer and use it in GitHub Desktop.
Save AndreVero/1e7ae27148ac989c35daa09d024b0c82 to your computer and use it in GitHub Desktop.
Change color of a picked item
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