Пример #1
0
 /**
  * Close the custom view applying an animation to close the view to the left side of the screen.
  */
 public void closeToLeft() {
   if (viewDragHelper.smoothSlideViewTo(
       dragView,
       -transformer.getOriginalWidth(),
       getHeight() - transformer.getMinHeightPlusMargin())) {
     ViewCompat.postInvalidateOnAnimation(this);
     notifyCloseToLeftListener();
   }
 }
Пример #2
0
 public int getDraggedViewHeightPlusMarginTop() {
   return transformer.getMinHeightPlusMargin();
 }
Пример #3
0
 /**
  * Calculate the vertical drag range between the custom view and dragged view.
  *
  * @return the difference between the custom view height and the dragged view height.
  */
 private float getVerticalDragRange() {
   return getHeight() - transformer.getMinHeightPlusMargin();
 }