Animation in items from a recyclerview

1

I'm trying to animate the items in a recyclerview and I want to do something like this:

What I currently do to animate the items in the recyclerview is the following:

 final Animation animation= AnimationUtils.loadAnimation(context,R.anim.prueba);
    viewholder.relativelayout.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {
            vh.rl.startAnimation(animation);
            return false;
        }
    });

When doing that the layout that is in that particular item moves to the right but I have the problem that if I do a little scroll or click another item, the previous item that made the animation is still on the right and it does not return to its current state. It only returns to its current state if the recyclerview reloads the item.

Any solution for that?

I have also been looking at the ItemAnimator but it is not very clear to me = /

    
asked by borjis 31.10.2016 в 18:02
source

0 answers