Open DanielRitvas opened 8 years ago
You should use global boolean parameter and then set dragFlags to 0 when drag&drop is off, otherwise set proper drag flags. @Override public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { int dragFlags = DriversSingleton.getDriversSingleton().isEditMode()? ItemTouchHelper.UP | ItemTouchHelper.DOWN | ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT:0; final int swipeFlags = 0; return makeMovementFlags(dragFlags, swipeFlags); }
Hello, I know how to disable drag and drop for specific type of ViewHolder at all, but how can I control it's "on/off" state from activity?