Android RecyclerView ItemTouchHelper revert swipe and restore view holder
You should override onSwiped
method in ItemTouchHelper.Callback
and refresh that particular item.
@Override
public void onSwiped(RecyclerView.ViewHolder viewHolder,
int direction) {
adapter.notifyItemChanged(viewHolder.getAdapterPosition());
}
After some random poking I found a solution. Call notifyItemChanged
on you adapter. This will make the swiped out view animate back into it's original position.