private void triggerOnReleaseActionsWhileHorizontalDrag ( float xVel ) { if ( xVel < 0 && xVel <= - X_MIN_VELOCITY ) { draggableView . closeToLeft ( ) ; } else if ( xVel > 0 && xVel >= X_MIN_VELOCITY ) { draggableView . closeToRight ( ) ; } else { if ( draggableView . isNextToLeftBound ( ) ) { draggableView . closeToLeft ( ) ; } else if ( draggableView . isNextToRightBound ( ) ) { draggableView . closeToRight ( ) ; } else { draggableView . minimize ( ) ; } } }
Close the view to the right to the left or minimize it using the draggableView position and the x axis velocity .