diff options
author | Andrew Dolgov <[email protected]> | 2012-10-17 16:52:06 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-10-17 16:52:06 +0400 |
commit | f3d4e3e31c488e5ded0a457308c746913aecef8c (patch) | |
tree | 854fe72aca15243510688d36174b1de02fb6a1b3 /src/it/sephiroth/android/library | |
parent | ca4459d88fa75b988918c30a9d024a3534c7c1a2 (diff) |
call onScaleListener from the correct place
Diffstat (limited to 'src/it/sephiroth/android/library')
-rw-r--r-- | src/it/sephiroth/android/library/imagezoom/ImageViewTouch.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/it/sephiroth/android/library/imagezoom/ImageViewTouch.java b/src/it/sephiroth/android/library/imagezoom/ImageViewTouch.java index f958bb9..c189cf8 100644 --- a/src/it/sephiroth/android/library/imagezoom/ImageViewTouch.java +++ b/src/it/sephiroth/android/library/imagezoom/ImageViewTouch.java @@ -112,13 +112,6 @@ public class ImageViewTouch extends ImageViewTouchBase { } break; } - if (mScaleChangedListener != null) { - RectF bitmapRect = getBitmapRect(); - - boolean widthFits = getWidth() >= (bitmapRect.right - bitmapRect.left); - - mScaleChangedListener.onScaleChanged(mCurrentScaleFactor, widthFits); - } return true; } @@ -126,6 +119,14 @@ public class ImageViewTouch extends ImageViewTouchBase { protected void onZoom( float scale ) { super.onZoom( scale ); if ( !mScaleDetector.isInProgress() ) mCurrentScaleFactor = scale; + + if (mScaleChangedListener != null) { + RectF bitmapRect = getBitmapRect(); + + boolean widthFits = getWidth() >= (bitmapRect.right - bitmapRect.left); + + mScaleChangedListener.onScaleChanged(mCurrentScaleFactor, widthFits); + } } protected float onDoubleTapPost( float scale, float maxZoom ) { |