Skip to content

Instantly share code, notes, and snippets.

@pauloaapereira
Created April 23, 2021 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pauloaapereira/026741cf937bc7cc750acb4792c5997e to your computer and use it in GitHub Desktop.
Save pauloaapereira/026741cf937bc7cc750acb4792c5997e to your computer and use it in GitHub Desktop.
Jetpack Compose - Earthquake Effect_7
@Immutable
interface IEarthquakeMover {
val x: Animatable<Float, AnimationVector1D>
val y: Animatable<Float, AnimationVector1D>
val rotation: Animatable<Float, AnimationVector1D>
val alpha: Animatable<Float, AnimationVector1D>
suspend fun move(shakeDuration: Int, shakeForce: Int)
suspend fun stop()
fun generateOffset(shakeForce: Int): Offset
fun generateRotation(shakeForce: Int): Float
fun generateAlpha(): Float
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment