@Override public boolean onMove( RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) { int start = viewHolder.getAdapterPosition(); int finish = target.getAdapterPosition(); return mAdapter.move(start, finish); }
@Override public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) { int position = viewHolder.getAdapterPosition(); if (direction == ItemTouchHelper.LEFT) mAdapter.swipeLeft(position); else mAdapter.swipeRight(position); }