Skip to content

Instantly share code, notes, and snippets.

@damanpreetsb
Last active May 26, 2019 16:48
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 damanpreetsb/017ab9f13e79611739f673fe2bd3ff4c to your computer and use it in GitHub Desktop.
Save damanpreetsb/017ab9f13e79611739f673fe2bd3ff4c to your computer and use it in GitHub Desktop.
val anim = ValueAnimator.ofInt(pizzaCrustImageView.measuredHeight, height)
anim.addUpdateListener { valueAnimator ->
val value = valueAnimator.animatedValue as Int
val layoutParams = pizzaCrustImageView.layoutParams
layoutParams.height = value
pizzaCrustImageView.layoutParams = layoutParams
pizzaCrustImageView.radius = value.div(2).toFloat()
}
anim.duration = 300
anim.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment