How to animate RecyclerView items when adapter is initialized (in order)?
<p><strong>What I'm trying to accomplish</strong></p>

<p>I want to make items in a linear vertical RecyclerView appear in order. I want the 1st item to appear, then the 2nd, then the 3rd and so on. Here is an example of the type of animation I'm trying to accomplish.</p>

<p><a href="https://i.stack.imgur.com/PvqGK.gif" rel="noreferrer"><img src="https://i.stack.imgur.com/PvqGK.gif" alt="animation example"></a></p>

<hr>

<p><strong>What I've tried</strong></p>

<p>I have tried the methods provided in this question: <a href="https://stackoverflow.com/questions/26724964/how-to-animate-recyclerview-items-when-they-appear">How to animate RecyclerView items when they appear</a></p>

<p>However, this is not quite what I'm trying to accomplish. This causes all the items in the RecyclerView to appear at once, rather than one at a time. </p>

<hr>

<p><strong>My code</strong></p>

<pre><code>public class ParentCommentsAdapter extends RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt; {

    private int lastPosition = -1;

    //constructor and other code not shown...

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) {
        switch (viewHolder.getItemViewType()) {
            case OP:
                OPViewHolder ovh = (OPViewHolder) viewHolder;
                configureOPViewHolder(ovh, position);
                setAnimation(ovh.getContainer(), position);
                break;
            case COMMENT:
                CommentViewHolder cvh = (CommentViewHolder) viewHolder;
                configureCommentViewHolder(cvh, position);
                setAnimation(cvh.getContainer(), position);
                break;
            default:
                RecyclerViewSimpleTextViewHolder vh = (RecyclerViewSimpleTextViewHolder) viewHolder;
                configureDefaultViewHolder(vh, position);
                break;
        }

    }

    @Override
    public void onViewDetachedFromWindow(final RecyclerView.ViewHolder viewHolder)
    {

        switch (viewHolder.getItemViewType()) {
            case OP:
                ((OPViewHolder)viewHolder).clearAnimation();
                break;
            case COMMENT:
                ((CommentViewHolder)viewHolder).clearAnimation();
                break;
            default:
                break;
        }
    }

    private void configureDefaultViewHolder(RecyclerViewSimpleTextViewHolder vh, int position) {
        //code...
    }

    private void configureOPViewHolder(OPViewHolder vh1, int position) {
        //code...
    }

    private void configureCommentViewHolder(CommentViewHolder vh2, int position) {
        //code...
    }

    private void setAnimation(View viewToAnimate, int position)
    {
        // If the bound view wasn't previously displayed on screen, it's animated
        if (position &gt; lastPosition)
        {
            Animation animation = AnimationUtils.loadAnimation(context, R.anim.fade_in);
            viewToAnimate.startAnimation(animation);
            lastPosition = position;
        }
    }

}
</code></pre>