Right Slide In RecyclerView Animation - Android User Interface

Android examples for User Interface:RecyclerView

Description

Right Slide In RecyclerView Animation

Demo Code


import android.content.Context;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.animation.DecelerateInterpolator;

public class Main{
    public static void RightSlideInAnim(RecyclerView.ViewHolder holder,
            int duration) {
        View itemView = holder.itemView;
        ViewCompat.setTranslationX(itemView, itemView.getRootView()
                .getWidth());//from   w w w.  ja v  a2  s  .c om
        ViewCompat.animate(itemView).translationX(0).setDuration(duration)
                .setInterpolator(new DecelerateInterpolator()).start();
    }
}

Related Tutorials