Skip to content

Instantly share code, notes, and snippets.

@AmaroNeto
Created February 26, 2020 17:13
Show Gist options
  • Save AmaroNeto/733269a5edba699fd86abba6a1ebe54f to your computer and use it in GitHub Desktop.
Save AmaroNeto/733269a5edba699fd86abba6a1ebe54f to your computer and use it in GitHub Desktop.
private fun collapseAnimation() {
val changeColor = AnimatorUtils.changeColor(
cardBox::setCardBackgroundColor,
ContextCompat.getColor(this, R.color.white),
ContextCompat.getColor(this, R.color.red),
500)
val resize = AnimatorUtils.resize(cardBox, newHeight, oldHeight, 250)
val fadeOut = AnimatorUtils.hideWithFadeOut(detail, 200)
val fadeIn = AnimatorUtils.showWithFadeIn(intro, 300)
AnimatorSet().apply {
playTogether(changeColor, resize, fadeOut)
play(fadeIn).after(fadeOut)
start()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment