Skip to content

Instantly share code, notes, and snippets.

Avatar
💪
Hustling

Damanpreet Singh damanpreetsb

💪
Hustling
View GitHub Profile
View ScaleUpPizzaXAnimation.kt
val scaleUpPizzaX = ObjectAnimator.ofFloat(pizzaImageView, "scaleX", 0f, 0.8f)
View FadeInPizzaAnimation.kt
val fadeInPizza = ObjectAnimator.ofFloat(pizzaImageView, "alpha", 0f, 1f)
View FadeCrustAnimation.kt
val fadeCrust = ObjectAnimator.ofFloat(pizzaCrustImageView, "alpha", 1f, 0f)
View FadeCheeseAnimation.kt
val fadeCheese = ObjectAnimator.ofFloat(pizzaCheeseImageView, "alpha", 1f, 0f)
View AnimateToppings.kt
ObjectAnimator.ofFloat(toppingsLayout,"translationY", 0f, toppingsLayout.height.toFloat() - 12f).apply {
interpolator = AccelerateInterpolator()
duration = 600
start()
}
View AnimateCrustHeight.kt
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()
View AnimateCheeseHeight.kt
val anim = ValueAnimator.ofInt(pizzaCheeseImageView.measuredHeight, height)
anim.addUpdateListener { valueAnimator ->
val value = valueAnimator.animatedValue as Int
val layoutParams = pizzaCheeseImageView.layoutParams
layoutParams.height = value
pizzaCheeseImageView.layoutParams = layoutParams
}
anim.duration = 300
anim.start()
View AnimateFrontCover.kt
frontCoverImageView
.animate()
.translationY(790f)
.setDuration(300)
.setListener(object : Animator.AnimatorListener {
override fun onAnimationEnd(animation: Animator?) {
backCoverImageView.visibility = VISIBLE
backCoverImageView.alpha = 1f
pizzaImageView.visibility = GONE
frontCoverImageView.visibility = GONE
View RotateBoxScaleDownXAnimation.kt
val scaleDownX = ObjectAnimator.ofFloat(backCoverImageView, "scaleX", 1f, 0.6f)
View RotateBoxScaleDownYAnimation.kt
val scaleDownY = ObjectAnimator.ofFloat(backCoverImageView, "scaleY", 1f, 0.6f)