Last active
June 14, 2022 18:10
-
-
Save dilrajsingh1997/c59daeb427e3c28302584db4483d7870 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// we are sending one item to the producerChannel at a time | |
ItemStateBuilder( | |
composeCanvasDrawItem = getPathCanvasObject(), | |
initialX = Random.nextInt(0, (width).toInt()).toFloat(), | |
initialY = (height - 200f), | |
) | |
.animateX( | |
to = { | |
initialX | |
}, | |
animationSpec = { | |
SinWaveAnimationSpec(durationMillis = 3500, multiplier = 100) | |
} | |
) | |
.animateY( | |
to = { | |
height / 2 | |
}, | |
animationSpec = { | |
tween(durationMillis = 3500, easing = FastOutSlowInEasing) | |
} | |
) | |
.animateAlpha( | |
to = { | |
0f | |
}, | |
animationSpec = { | |
tween(durationMillis = 5500, easing = LinearEasing) | |
} | |
) | |
.animateAngle( | |
to = { | |
1440f | |
}, | |
animationSpec = { | |
tween(durationMillis = 2500, easing = FastOutSlowInEasing) | |
} | |
) | |
.animateColor( | |
to = { | |
Color.Green | |
}, | |
animationSpec = { | |
tween(durationMillis = 2000) | |
} | |
) | |
.animateSize( | |
to = { | |
2.0f | |
}, | |
animationSpec = { | |
spring(dampingRatio = Spring.DampingRatioHighBouncy) | |
} | |
) | |
.build() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment