@Override
        public int clampViewPositionHorizontal(View child, int left, int dx) {

            int result = 0;

            if (dragDirectMode == DragDirectMode.HORIZONTAL) {
                if (!canChildScrollRight() && left > 0) {
                    dragEdge = DragEdge.LEFT;
                } else if (!canChildScrollLeft() && left < 0) {
                    dragEdge = DragEdge.RIGHT;
                }
            }

            if (dragEdge == DragEdge.LEFT && !canChildScrollRight() && left > 0) {
                final int leftBound = getPaddingLeft();
                final int rightBound = horizontalDragRange;
                result = Math.min(Math.max(left, leftBound), rightBound);
            } else if (dragEdge == DragEdge.RIGHT && !canChildScrollLeft() && left < 0) {
                final int leftBound = -horizontalDragRange;
                final int rightBound = getPaddingLeft();
                result = Math.min(Math.max(left, leftBound), rightBound);
            }

            return result;
        }
Find out the scrollable child view from a ViewGroup.

@param viewGroup
library/src/main/java/com/liuguangqiang/swipeback/SwipeBackLayout.java