Posts

Showing posts from May, 2019

RecyclerView item animation

if (imageView. isSelected ) { ValueAnimator.ofInt(size, (size * 1.8 ).toInt()). apply { addUpdateListener { values -> imageView. layoutParams . width = values. animatedValue as Int imageView. layoutParams . height = values. animatedValue as Int imageView.requestLayout() } duration = 200 start() } val anim = ScaleAnimation( 0.5f , 1f , 0.5f , 1f , Animation. RELATIVE_TO_SELF , 0.5f , Animation. RELATIVE_TO_SELF , 0.5f ) anim. fillAfter = true imageView.startAnimation(anim) } else { imageView. layoutParams . width = size imageView. layoutParams . height = size }