class NestedScrollView extends FrameLayout implements NestedScrollingParent2,
        NestedScrollingChild2, ScrollingView {

    int getScrollRange() {
        int scrollRange = 0;
        if (getChildCount() > 0) {
            View child = getChildAt(0);// NestedScrollView只能嵌套一个子View
            NestedScrollView.LayoutParams lp = (LayoutParams) child.getLayoutParams();
            int childSize = child.getHeight() + lp.topMargin + lp.bottomMargin;
            int parentSpace = getHeight() - getPaddingTop() - getPaddingBottom();
            scrollRange = Math.max(0, childSize - parentSpace);
        }
        return scrollRange;
    }

    public  NestedScrollView(@NonNull Context context);
    public  NestedScrollView(@NonNull Context context, @Nullable AttributeSet attrs);
    public  NestedScrollView(@NonNull Context context, @Nullable AttributeSet attrs,
                            int defStyleAttr);

}