-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zoomed image plus ViewPage #38
Comments
You should extend the ImageViewZoom with your own ImageView subclass. Then try something like this: this.setOnTouchListener(new OnTouchListener() { This should basically disallow paging whenever the image is scaled/zoomed beyond 1x. Thus, the user must zoom out in order to page. |
Thank you, thats a good idea, but is it possible to do without zoom out, I mean when it reaches the max bound, let the parent allow. |
@femosso : Thats not what I meant. How do I know user reached to max bound ? |
did you solve this problem , i have this too ! |
Nope, I used the above method. |
I know this is a very old post but i couldnt find a solution else where other than this so if anyones der please respond.@cargo8 solution works fine but the getScale() method seems to be deprecated in the present versions of android. So i used getScaleFactor() method. But it returns value as 1.0 however your resize your image. How can we check the actual scale value of the image? |
Try this : imageviewtouch.setOnTouchListener(new View.OnTouchListener() {
This will disable scrollview for taking touch event from imageviewtoich if the imageviewtouch still getting touch, will enable scroll on parent after imageviewtouch not receiving touch. |
Assume there are 2 images in a ViewPager and when zooming the first one and try to pan(drag), the parent viewpager scrolls to second image instead of image panning. Using this.getParent().requestDisallowInterceptTouchEvent(true); inside onTouchEvent of does the trick but where should I allow it. If you can update the code, it would be awesome. I'm new to android.
The text was updated successfully, but these errors were encountered: