public void setScale(float scale, float focalX, float focalY,
                         boolean animate) {
        // Check to see if the scale is within bounds
        if (scale < mMinScale || scale > mMaxScale) {
            throw new IllegalArgumentException("Scale must be within the range of minScale and maxScale");
        }

        if (animate) {
            mImageView.post(new AnimatedZoomRunnable(getScale(), scale,
                    focalX, focalY));
        } else {
            mSuppMatrix.setScale(scale, scale, focalX, focalY);
            checkAndDisplayMatrix();
        }
    }
The component of {@link PhotoView} which does the work allowing for zooming, scaling, panning, etc.
It is made public in case you need to subclass something other than {@link ImageView} and still
gain the functionality that {@link PhotoView} offers
main/src/main/java/com/quxianggif/common/view/photoview/PhotoViewAttacher.java