Android(安卓)ScrollView滑动到顶部和滑动到底部的判断

svView.setOnScrollChangeListener(new View.OnScrollChangeListener() {            @Override            public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {                if (svView.getScrollY() == 0) {                    //顶部                }                View contentView = svView.getChildAt(0);                if (contentView != null && contentView.getMeasuredHeight() == (svView.getScrollY() + svView.getHeight())) {                    //底部                }            }        });