Skip to content

Instantly share code, notes, and snippets.

View damanpreetsb's full-sized avatar
💪
Hustling

Damanpreet Singh damanpreetsb

💪
Hustling
View GitHub Profile
ObjectAnimator.ofFloat(toppingsLayout,"translationY", 0f, toppingsLayout.height.toFloat() - 12f).apply {
interpolator = AccelerateInterpolator()
duration = 600
start()
}
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
val scaleDownX = ObjectAnimator.ofFloat(backCoverImageView, "scaleX", 1f, 0.6f)
val scaleDownY = ObjectAnimator.ofFloat(backCoverImageView, "scaleY", 1f, 0.6f)
val rotateBox = ObjectAnimator.ofFloat(backCoverImageView, "rotation", 0f, -45f)
val translateX = ObjectAnimator.ofFloat(backCoverImageView, "translationX", 0f, 1000f)
AnimatorSet().apply { play(scaleDownX).with(scaleDownY).with(rotateBox).before(translateX) }
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()
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()
class AppComponent extends React.Component {
render() {
return (
<div>
<h1>{this.props.name}</h1>
</div>
);
}
}