private void ensureTarget() {
        if (target == null) {
            if (getChildCount() > 1) {
                throw new IllegalStateException("SwipeBackLayout must contains only one direct child");
            }
            target = getChildAt(0);

            if (scrollChild == null && target != null) {
                if (target instanceof ViewGroup) {
                    findScrollView((ViewGroup) target);
                } else {
                    scrollChild = target;
                }

            }
        }
    }
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