xxfast
05/16/2022, 1:44 AManimateColorBetween()
only available in compose >1.2?Ben Trengrove [G]
05/16/2022, 1:50 AMBen Trengrove [G]
05/16/2022, 1:52 AM@Composable
fun animateColorBetween(start: Color, end: Color): State<Color> {
val infiniteTransition = rememberInfiniteTransition()
return infiniteTransition.animateColor(
initialValue = start,
targetValue = end,
animationSpec = infiniteRepeatable(
animation = tween(1000, easing = LinearOutSlowInEasing),
repeatMode = RepeatMode.Reverse
)
)
}
Colton Idle
05/16/2022, 3:27 AMBen Trengrove [G]
05/16/2022, 3:29 AMColton Idle
05/16/2022, 3:53 AM