code: public void closeToRight() {
      if (viewDragHelper.smoothSlideViewTo(dragView, transformer.getOriginalWidth(),
          getHeight() - transformer.getMinHeightPlusMargin())) {
        ViewCompat.postInvalidateOnAnimation(this);
        notifyCloseToRightListener();
      }
    }
docs: Close the custom view applying an animation to close the view to the right side of the screen.