Slide 14
Slide 14 text
This work is licensed under the Apache 2.0 License
반복 (Repeating) 애니메이션
InfiniteTransition
반복적인 애니메이션 처리에 사용합니다. 이 API
는 Transition API 와 유사합니다. 둘 다 여러 값에
애니메이션을 적용하지만 Transition은 상태 변경
에 따라 값에 애니메이션을 한 번 적용하고,
Infinite Transition은 값에 무기한으로 애니메이션
을 적용합니다.
Link: https://developer.android.com/jetpack/compose/animation?hl=ko
val infiniteTransition = rememberInfiniteTransition()
val color by infiniteTransition.animateColor(
initialValue = Color.Red,
targetValue = Color.Green,
animationSpec = infiniteRepeatable(
animation = tween(1000, easing= LinearEasing),
repeatMode = RepeatMode.Reverse
)
)
Box(Modifier.fillMaxSize().background(color))