RecyclerView sliding Animation - Android Animation

Android examples for Animation:Slide Animation

Description

RecyclerView sliding Animation

Demo Code


import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.support.v7.widget.RecyclerView;

public class Main{
    private static void slidingAnimation(RecyclerView.ViewHolder holder,
            boolean goesDown) {

        ObjectAnimator animatorTranslateY = ObjectAnimator.ofFloat(
                holder.itemView, "translationY", goesDown ? 200 : -200, 0);

        animatorTranslateY.setDuration(1000);

        animatorTranslateY.start();/*  ww w.j  av  a  2s .  c om*/

    }
}

Related Tutorials