user6496268
user6496268

Reputation:

google plus recyclerView scrolling animation

I would like to know how to animate a recyclerView with an animation like the google plus app. Here I have an answer How to animate recyclerview on scroll like Google plus/Google newsstand? but I am having issues with the context and the "last position" thing, he says make a field but I don't know what that means.

Upvotes: 1

Views: 460

Answers (1)

Sagar Jogadia
Sagar Jogadia

Reputation: 1350

Try this:

@Override
public void onBindViewHolder(ViewHolder holder, int position) {

        //Your content here

        setAnimation(holder.itemView);
}


private void setAnimation(ViewHolder holder) {
            ObjectAnimator.ofFloat(holder.itemView, "translationX", initialValue, finalValue)
                    .setDuration(1000)
                    .start();
        }

Refer to this link for further information

Upvotes: 1

Related Questions