yellowcath / PhotoView

Implementation of ImageView for Android that supports zooming, by various touch gestures.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PhotoView

expand PhotoView to support customized ScaleType

    int myScaleType = 123;
    attacher.setScaleType(myScaleType);
    attacher.setScaleTypeStrategy((srcRect, dstRect, baseMatrix, scaleType) -> {
        if(scaleType == myScaleType){
            //dosomething to baseMatrix
        }
    });

and DoubleTapStrategy

        //like Weibo
        attacher.setDoubleTapStrategy((photoViewAttacher, scale, x, y) -> {
            if(Math.abs(scale-photoViewAttacher.getMediumScale())<0.001f){
                photoViewAttacher.setScale(photoViewAttacher.getMaximumScale(),x,y,true);
            }else{
                photoViewAttacher.setScale(photoViewAttacher.getMediumScale(),x,y,true);
            }
            return true;
        });

About

Implementation of ImageView for Android that supports zooming, by various touch gestures.

License:Apache License 2.0


Languages

Language:Java 100.0%