https://kotlinlang.org logo
#compose
Title
# compose
t

Tolriq

04/02/2022, 5:56 PM
Is there an easy / simple way to add some delay to:
Copy code
val animatedColor by animateColorAsState(
  if (isPlaying) Color.Transparent else MaterialTheme.colorScheme.surface,
)
t

Tobias Gronbach

04/04/2022, 12:18 AM
val animatedColor by animateColorAsState( if (isPlaying) Color.Transparent else MaterialTheme.colorScheme.surface, animationSpec = tween( durationMillis = 2000, delayMillis = 1000, easing = LinearOutSlowInEasing ) )
t

Tolriq

04/04/2022, 6:15 AM
Thanks that's what I ended up doing but the default animation is spring and it does not have the delay so I need to change the others to match too. Was wondering if there was some more generic way.
3 Views