scale XY RecyclerView - Android Animation

Android examples for Animation:Scale Animation

Description

scale XY RecyclerView

Demo Code


import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.OvershootInterpolator;

public class Main{
    public static void scaleXY(RecyclerView.ViewHolder holder) {
        holder.itemView.setScaleX(0);/*from   w  w  w  .  j ava  2  s .  c  o m*/
        holder.itemView.setScaleY(0);

        PropertyValuesHolder propx = PropertyValuesHolder.ofFloat("scaleX",
                1);
        PropertyValuesHolder propy = PropertyValuesHolder.ofFloat("scaleY",
                1);

        ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(
                holder.itemView, propx, propy);

        animator.setDuration(800);
        animator.start();
    }
}

Related Tutorials