Android ImageView widget with zoom and pan capabilities
Java
Pull request Compare This branch is 6 commits ahead, 99 commits behind sephiroth74:master.
Latest commit 7c22635 Oct 21, 2012 alik@cloudengines.com - Find ImageViewTouch even if not the selected view/item
- Send all events to gellery instead of sending UP events when handled byt ImageViewTouch.
  This makes the gallery more responsive and less jumps. The downside is that the zommed image scroll makes the gallery scroll as well.
  I need to find a better way to disable the gallery scrolling when scrolling a zoomed image.

README.md

ImageViewZoom

Android ImageView widget with zoom and pan capabilities. This is an implementation of the ImageView widget used in the Gallery app of the Android opensource project.

Checkout the repository and run the ImageViewTouchTest project to see how it works. Beside the superclass setImageBitmap method it offers the following methods:

  • setImageDrawable( Drawable drawable )
  • setImageBitmap( final Bitmap bitmap, final boolean reset )
  • setImageBitmap( final Bitmap bitmap, final boolean reset, Matrix matrix )
  • setImageBitmap( final Bitmap bitmap, final boolean reset, Matrix matrix, float maxZoom )

If you want to load a new Bitmap with a particular zoom/pan state (let's say the same from another imageview ), you can call:

Matrix matrix = mImageView1.getDisplayMatrix();
mImageView2.setImageBitmap( bitmap, true, matrix );