@Override
                public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
                    if (velocityY > FLING_VELOCITY_SLOP) {
                        if (lastFlingStatus.equals(Status.OPENED) && -getScrollY() > maxOffset) {
                            lastFlingStatus = Status.EXIT;
                            scrollToExit();
                        } else {
                            scrollToOpen();
                            lastFlingStatus = Status.OPENED;
                        }
                        return true;
                    } else if (velocityY < FLING_VELOCITY_SLOP && getScrollY() <= -maxOffset) {
                        scrollToOpen();
                        lastFlingStatus = Status.OPENED;
                        return true;
                    } else if (velocityY < FLING_VELOCITY_SLOP && getScrollY() > -maxOffset) {
                        scrollToClose();
                        lastFlingStatus = Status.CLOSED;
                        return true;
                    }
                    return false;
                }
Layout that can scroll down to a max offset and can tell the scroll progress by
OnScrollProgressListener.
scrolllayout/src/main/java/com/yinglan/scrolllayout/ScrollLayout.java