Skip to content

Instantly share code, notes, and snippets.

@andreymusth
Created August 13, 2021 11:27
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 andreymusth/960292064703bddaa3301b4f87502157 to your computer and use it in GitHub Desktop.
Save andreymusth/960292064703bddaa3301b4f87502157 to your computer and use it in GitHub Desktop.
animate color as state
val color by animateColorAsState(
targetValue = if (isSelected) {
Color.White
} else {
Color.Black
},
animationSpec = tween(durationMillis = 100, easing = LinearEasing)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment