martinwithaar / PinchToZoom

Android's ImageView pinch-to-zoom made easy
MIT License
110 stars 27 forks source link

How to disable the screen edges block #10

Closed cubycode closed 6 years ago

cubycode commented 6 years ago

Hi there, When I zoom an image into its original size, then I cannot drag it around, I have to zoom it out until it gets bigger than the screen's width, then I can move it, otherwise I can only zoom in an out and the image stays in the center of my relative layout. How can I disable this block? (Hope my question is clear :)

martinwithaar commented 6 years ago

For now this is not possible. The problem with this is that you can drag the image outside of the view and have difficulty to move it back into view when you don't know its position. A restraint that allows the image to move outside the view in its entirety but then blocks if you try to drag it even further away from the viewport might be an option worth looking into. With my current schedule however I can't make any guarantee whether I'll pick this up or when.

cubycode commented 6 years ago

thanks for your reply, your code works smoothly, the only thing i needed was the ability to still move the imageview anywhere in my layout, i know it can get outside my layout but i want to take the risk, i’m using your code to add png stickers over another imageview, so i would need to pinch/zoom them and move them anywhere, that’s all, maybe i can comment some line of your code to do that?

martinwithaar commented 6 years ago

Please take a look at #12. The answer to that question should also help you.