Permalink
Browse files

Remove item from adapter after animation

  • Loading branch information...
david-szabo97 committed Dec 12, 2017
1 parent e5fbb4e commit 5b1ad64ea95026576c452526cccf0406b9e0e494
@@ -68,7 +68,12 @@ public void onSwipeLeft(RecyclerView.ViewHolder vh) {
helper.attachToRecyclerView(recyclerView);
// Add animation
CustomItemAnimator animator = new CustomItemAnimator();
CustomItemAnimator animator = new CustomItemAnimator(new CustomItemAnimator.onAnimationEndListener() {
@Override
public void onChangeEnd(RecyclerView.ViewHolder newHolder) {
adapter.remove(newHolder.getAdapterPosition());
}
});
recyclerView.setItemAnimator(animator);
}

0 comments on commit 5b1ad64

Please sign in to comment.