9

I created an app that has a small image loaded from URL of a website. I want that when user clicks on that small image it'll show the image in full screen and will also have the ability to zoom and pan that image.

What I've done was showing the image in WebView with built-in zoom controls but the result was ugly. (I've set the layout to wrap_content so no white areas are shown, but it cause the image doesn't zoom dynamically).

Any solution? and sorry for my bad English.

Community
  • 1
  • 1
Bigdragon
  • 352
  • 1
  • 4
  • 16

3 Answers3

11

Problem solved! For anyone who have the same problem, I've use this library and it works great! http://blog.sephiroth.it/2011/04/04/imageview-zoom-and-scroll/

Here's a link to the Github ImageViewZoom page.

Herman Schaaf
  • 46,821
  • 21
  • 100
  • 139
Bigdragon
  • 352
  • 1
  • 4
  • 16
1

You can build that from scratch or... you can use this library:

http://code.google.com/p/android-pinch

Take a look at the PinchImageView class

Cristian
  • 198,401
  • 62
  • 356
  • 264
0

You need to use GestureDetectors. Google has excellent sample interactiveChart for this, see https://android.googlesource.com/platform/development/+/master/samples/training/InteractiveChart and http://developer.android.com/training/gestures/scroll.html

Zhenlei Cai
  • 123
  • 1
  • 7
  • Here's an adequate solution. https://stackoverflow.com/questions/6578320/how-to-apply-zoom-drag-and-rotation-to-an-image-in-android/47861501#47861501 – user2288580 Dec 18 '17 at 03:18