public boolean pageScroll(int direction) {
        boolean down = direction == View.FOCUS_DOWN;
        int height = getHeight();

        if (down) {
            mTempRect.top = getScrollY() + height;
            int count = getChildCount();
            if (count > 0) {
                View view = getChildAt(count - 1);
                if (mTempRect.top + height > view.getBottom()) {
                    mTempRect.top = view.getBottom() - height;
                }
            }
        } else {
            mTempRect.top = getScrollY() - height;
            if (mTempRect.top < 0) {
                mTempRect.top = 0;
            }
        }
        mTempRect.bottom = mTempRect.top + height;

        return scrollAndFocus(direction, mTempRect.top, mTempRect.bottom);
    }
<p>Handles scrolling in response to a "page up/down" shortcut press. This
method will scroll the view by one page up or down and give the focus
to the topmost/bottommost component in the new visible area. If no
component is a good candidate for focus, this scrollview reclaims the
focus.</p>

@param direction the scroll direction: {@link View#FOCUS_UP}
                 to go one page up or
                 {@link View#FOCUS_DOWN} to go one page down
@return true if the key event is consumed by this method, false otherwise
app/src/main/java/home/smart/fly/animations/widget/NestedScrollView.java