@Override
        public int clampViewPositionVertical(View child, int top, int dy) {

            int result = 0;

            if (dragDirectMode == DragDirectMode.VERTICAL) {
                if (!canChildScrollUp() && top > 0) {
                    dragEdge = DragEdge.TOP;
                } else if (!canChildScrollDown() && top < 0) {
                    dragEdge = DragEdge.BOTTOM;
                }
            }

            if (dragEdge == DragEdge.TOP && !canChildScrollUp() && top > 0) {
                final int topBound = getPaddingTop();
                final int bottomBound = verticalDragRange;
                result = Math.min(Math.max(top, topBound), bottomBound);
            } else if (dragEdge == DragEdge.BOTTOM && !canChildScrollDown() && top < 0) {
                final int topBound = -verticalDragRange;
                final int bottomBound = getPaddingTop();
                result = Math.min(Math.max(top, topBound), bottomBound);
            }

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

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