Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sagar-viradiya/d3bc734fad49d7f062ff6d5eeb411f52 to your computer and use it in GitHub Desktop.
Save sagar-viradiya/d3bc734fad49d7f062ff6d5eeb411f52 to your computer and use it in GitHub Desktop.
inline fun <K: View> K.springAnimationOf(property: FloatPropertyCompat<K>,
func: SpringForce.() -> Unit): SpringAnimation {
val springAnimation = SpringAnimation(this, property)
val springForce = SpringForce()
springForce.func()
springAnimation.spring = springForce
return springAnimation
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment