code: @Override public int clampViewPositionVertical(View child, int top, int dy) {
      int newTop = draggableView.getHeight() - draggableView.getDraggedViewHeightPlusMarginTop();
      if (draggableView.isMinimized() && Math.abs(dy) >= MINIMUM_DY_FOR_VERTICAL_DRAG
          || (!draggableView.isMinimized() && !draggableView.isDragViewAtBottom())) {
  
        final int topBound = draggableView.getPaddingTop();
        final int bottomBound = draggableView.getHeight()
            - draggableView.getDraggedViewHeightPlusMarginTop()
            - draggedView.getPaddingBottom();
  
        newTop = Math.min(Math.max(top, topBound), bottomBound);
      }
      return newTop;
    }
docs: Override method used to configure the vertical drag. Restrict the motion of the dragged child
  view along the vertical axis.
  
  @param child child view being dragged.
  @param top attempted motion along the Y axis.
  @param dy proposed change in position for top.
  @return the new clamped position for top.