package com.csl.codedemos.recyclerview.MyItemTouchHelper;

import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;

/**
 * author: laichangsen | create time: 2017/5/10
 */
public class ItemTouchHelperCallBack extends ItemTouchHelper.Callback {


    @Override
    public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
        return makeMovementFlags(ItemTouchHelper.START|ItemTouchHelper.END, 0);
    }

    @Override
    public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
        return true;
    }

    @Override
    public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {

    }

    @Override
    public boolean isLongPressDragEnabled() {
        return false;
    }

    @Override
    public boolean isItemViewSwipeEnabled() {
        return false;
    }
}

@@ -634,20 +634,390 @@
     
-return true;
+/*%0A         if (recyclerView.getAdapter() instanceof OnItemMoveListener) %7B%0A         OnItemMoveListener listener = ((OnItemMoveListener) recyclerView.getAdapter());%0A         listener.onItemMove(viewHolder.getAdapterPosition(), target.getAdapterPosition());%0A         %7D%0A         */%0A        return true;  //  %E9%85%8D%E5%90%88 RecyclerView %E7%9A%84 adapter %E7%9A%84 notifyItemMoved(int fromPosition, int toPosition)
 %0A   
@@ -1191,30 +1191,46 @@
      return 
-false;
+true;  //  todo %E9%95%BF%E6%8C%89%E6%94%AF%E6%8C%81%E6%8B%96%E5%8A%A8
 %0A    %7D%0A%0A    
@@ -1277,32 +1277,32 @@
 wipeEnabled() %7B%0A
-
         return f
@@ -1306,16 +1306,27 @@
 n false;
+  //  %E4%B8%8D%E6%94%AF%E6%8C%81%E6%BB%91%E5%8A%A8
 %0A    %7D%0A%7D

add ItemTouchHelper.Callback annotation