How to override doubletap of PhotoView

1k Views Asked by At

I want to set scale=4 after doubletap

in onCreate():

         imageView = (ImageView)rootView.findViewById(R.id.imageView1);
         mAttacher = new PhotoViewAttacher(imageView);
         imageLoader.displayImage(globalWallImages.get(position).preview, imageView, options);
         mAttacher.setOnDoubleTapListener(this);

I'm setting mAttacher.setOnDoubleTapListener(this); and in method of this interface doing it:

public boolean onDoubleTap(MotionEvent e) {
        Log.e("","onDoubleTap");
        mAttacher.setScale(4);
        return true;
    }

but image don't want to scale

1

There are 1 best solutions below

0
On BEST ANSWER

found solution

by defauld MaximumScale is < 4, so I add:

mAttacher.setMaximumScale(5f);