DragLinearLayout icon indicating copy to clipboard operation
DragLinearLayout copied to clipboard

Add Ability to Disable View Draggability

Open DanStout opened this issue 8 years ago • 1 comments

It would be nice to be able to make views which are currently draggable non-draggable. Maybe like this:

Current: public void setViewDraggable(View child, View dragHandle) Possibe: public void setViewDraggable(View child, View dragHandle, boolean isDraggable)

DanStout avatar Mar 29 '17 15:03 DanStout

Add this method in class to disable view draggability. Then u can disable, throw by for loop every view in list

public void disableViewDraggable(View child, View dragHandle){
        if (null == child || null == dragHandle) {
            throw new IllegalArgumentException(
                    "Draggable children and their drag handles must not be null.");
        }
        if (this == child.getParent()) {
            dragHandle.setOnTouchListener(null);  //set null
            draggableChildren.delete(indexOfChild(child));
        } else {
            Log.e(LOG_TAG, child + " is not a child, cannot make draggable.");
        }
} 

kairliyev avatar Jun 27 '20 10:06 kairliyev