code: @Override public void updateScale(float verticalDragOffset) {
      layoutParams.width = (int) (getOriginalWidth() * (1 - verticalDragOffset / getXScaleFactor()));
      layoutParams.height = (int) (getOriginalHeight() * (1 - verticalDragOffset / getYScaleFactor()));
  
      getView().setLayoutParams(layoutParams);
    }
docs: Changes view scale using view's LayoutParam.
  
  @param verticalDragOffset used to calculate the new size.