code: @Override
    public void updatePosition(float verticalDragOffset) {
      int right = getViewRightPosition(verticalDragOffset);
      int left = right - layoutParams.width;
      int top = getView().getTop();
      int bottom = top + layoutParams.height;
  
      getView().layout(left, top, right, bottom);
    }
docs: Changes X view position using layout() method.
  
  @param verticalDragOffset used to calculate the new X position.