Stylianos Gakis
07/06/2023, 10:33 AMval transition = rememberInfiniteTransition()
val color by transition.animateColor(
initialValue = Color.Red,
targetValue = Color.Red,
animationSpec = infiniteRepeatable(
animation = keyframes {
durationMillis = 500
Color.White atFraction 0f
Color.Magenta atFraction 0.33f
Color.White atFraction 0.66f
Color.White atFraction 1f
},
repeatMode = RepeatMode.Restart,
),
label = "color transition",
)
initialValue
and targetValue
are simply ignored, Red is never shown since we are specifying the colors inside the keyFrames dsl instead for how the transition should look like.
Is it because I am misusing the API in some way, is there something else I should be using here instead, or is it just a bit of a shortcoming in how this API has shaped itself while supporting all the different approaches, like tween, keyFrames etc.Chris Sinco [G]
07/08/2023, 5:31 AMStylianos Gakis
07/08/2023, 9:30 PM