recyclerview-animators
recyclerview-animators copied to clipboard
No animation unless OvershootInterpolator is set
Hi. I am using only notifyItemRemoved() and notifyItemInserted(), so to avoid notifyDataSetChanged(). When I set the item animator on the RecyclerView, the animation when adding a new element (SlideInUpAnimator) is not shown, unless I set OvershootInterpolator too.
So, when using this code:
mRecyclerView.setItemAnimator(new SlideInUpAnimator());
mRecyclerView.getItemAnimator().setAddDuration(1000);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
There is no animation. But with the next code, it shows the element sliding in from below, but with the bouncing effect (which I do not want to have):
mRecyclerView.setItemAnimator(new SlideInUpAnimator(new OvershootInterpolator()));
mRecyclerView.getItemAnimator().setAddDuration(1000);
mRecyclerView.setLayoutManager(new LinearLayoutManager(JobsUserActivity.this));
I am using these in gradle:
compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:recyclerview-v7:23.1.1' compile 'jp.wasabeef:recyclerview-animators:2.1.0'