private void chkDragable() {
        setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View view, MotionEvent motionEvent) {

                if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
                    lastY = motionEvent.getRawY();
                    lastX = motionEvent.getRawX();
                } else if (motionEvent.getAction() == MotionEvent.ACTION_MOVE) {
                    newY = motionEvent.getRawY();
                    lastX = motionEvent.getRawX();

                    offsetY = Math.abs(newY - lastY);
                    lastY = newY;

                    offsetX = Math.abs(newX - lastX);
                    lastX = newX;

                    switch (dragEdge) {
                        case TOP:
                        case BOTTOM:
                            setEnablePullToBack(offsetY > offsetX);
                        case LEFT:
                        case RIGHT:
                            setEnablePullToBack(offsetY < offsetX);
                            break;
                    }
                }

                return false;
            }
        });
    }
This should be added first than any other setting, because it will overwrite the viewDragHelper

@param onFinishListener listener for what to do when view reach the end
library/src/main/java/com/liuguangqiang/swipeback/SwipeBackLayout.java