I am using TouchImageView
by Mike Ortize with my custom ViewPager
as suggested by Mike Ortize.
My question is, how to scroll to next image in ViewPager
if the current image is in zoomed state ?
Currently, in my implementation the ViewPager
takes to next screen only after zooming out the image. I am using getParent().requestDisallowInterceptTouchEvent(boolean);
to control the switching of the touch event handling between TouchImageView
and my custom ViewPager
. If I don't do it then I can not pan the image horizontally, as the viewpager takes me to next image.
One solution I think of is, getting the edges of Image
& ImageView
and detecting the direction of scroll. Then using this,switch the touchlistener from TouchImageView
to its Parent ViewPager
.
I got this idea from PhotoView library by Chris Banes.
Any help is highly appreciated.
EDIT:
I did refer to the question View Pager + ImageView +Pinch Zoom + Rotation
For the custom ViewPager I am referring to Answer by Mike Ortize