Baseflow / PhotoView

Implementation of ImageView for Android that supports zooming, by various touch gestures.
https://baseflow.com
Apache License 2.0
18.78k stars 3.92k forks source link

Pinch zoom stopped working on 2.0.0 #587

Open sup-fmarais opened 6 years ago

sup-fmarais commented 6 years ago

The pinch zoom or double click zoom seemed to have stopped working after updating to 2.0.0 worked 100% on v1.3.1

Any ideas would be helpful please!

public class ZoomableImageViewTarget extends ImageViewTarget<Drawable> {
    public ZoomableImageViewTarget(ImageView view) {
        super(view);
    }

    @Override
    public void onResourceReady(Drawable resource, @Nullable Transition<? super Drawable> transition) {
        super.onResourceReady(resource, transition);

        PhotoViewAttacher photoViewAttacher = new PhotoViewAttacher(view);
        photoViewAttacher.setZoomable(true);
        photoViewAttacher.update();
    }

    @Override
    protected void setResource(@Nullable Drawable resource) {
    }
}
divaypandey commented 6 years ago

Make sure you have the scale type of the imageview set to matrix.
imv.setScaleType(ImageView.ScaleType.MATRIX);