Created
May 31, 2022 11:49
-
-
Save dilrajsingh1997/a06c404df523a2ef6b1eb038f58a4342 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
data class ItemState constructor( | |
val id: String = UUID.randomUUID().toString(), | |
val x: Float, | |
val y: Float, | |
val alpha: Float, | |
val scale: Float, | |
val angle: Float, | |
val color: Color, | |
val xAnimation: Animation<Float, AnimationVector1D>, | |
val yAnimation: Animation<Float, AnimationVector1D>, | |
val alphaAnimation: Animation<Float, AnimationVector1D>, | |
val scaleAnimation: Animation<Float, AnimationVector1D>, | |
val angleAnimation: Animation<Float, AnimationVector1D>, | |
val colorAnimation: Animation<Color, AnimationVector4D>, | |
val time: Long = System.nanoTime(), | |
val itemToDraw: ComposeCanvasDrawItem, | |
val terminalCondition: ( | |
interpolatedX: Float, | |
interpolatedY: Float, | |
interpolatedAlpha: Float, | |
interpolatedAngle: Float, | |
interpolatedColor: Color, | |
interpolatedScale: Float, | |
elapsedTimeMillis: Float | |
) -> Boolean = { interpolatedX, interpolatedY, interpolatedAlpha, _, _, _, _ -> | |
interpolatedX < 0 || interpolatedY < 0 || interpolatedAlpha < 0.05 | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment