@ 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 ; }
Override method used to configure the vertical drag . Restrict the motion of the dragged child view along the vertical axis .