File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
compose/snippets/src/main/java/com/example/compose/snippets/animations Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 1919package com.example.compose.snippets.animations
2020
2121import androidx.compose.animation.Animatable
22+ import androidx.compose.animation.core.Animatable
2223import androidx.compose.animation.AnimatedContent
2324import androidx.compose.animation.AnimatedVisibility
2425import androidx.compose.animation.Crossfade
@@ -739,7 +740,6 @@ private fun AnimationSpecKeyframeWithSpline() {
739740 // [END android_compose_animation_spec_keyframes_with_spline]
740741}
741742
742- @Suppress(" PrimitiveInCollection" )
743743@OptIn(ExperimentalAnimationSpecApi ::class )
744744@Preview
745745@Composable
@@ -792,8 +792,7 @@ private fun OffsetKeyframeWithSplineDemo() {
792792 durationMillis = 4400
793793
794794 // Increasingly approach the halfway point moving from side to side
795- repeat(4 ) {
796- val i = it + 1
795+ for (i in 0 .. 4 ) {
797796 val sign = if (i % 2 == 0 ) 1 else - 1
798797 Offset (
799798 x = maxXOff * (i.toFloat() / 5f ) * sign,
@@ -805,8 +804,7 @@ private fun OffsetKeyframeWithSplineDemo() {
805804 Offset (0f , maxYOff) atFraction 0.5f
806805
807806 // Return with mirrored movement
808- repeat(4 ) {
809- val i = it + 1
807+ for (i in 0 .. 4 ) {
810808 val sign = if (i % 2 == 0 ) 1 else - 1
811809 Offset (
812810 x = maxXOff * (1f - i.toFloat() / 5f ) * sign,
You can’t perform that action at this time.
0 commit comments