@@ -42,6 +42,7 @@ open class TouchImageView @JvmOverloads constructor(context: Context, attrs: Att
4242 private var touchMatrix: Matrix
4343 private var prevMatrix: Matrix
4444 var isZoomEnabled = false
45+ var isSuperZoomEnabled = true
4546 private var isRotateImageToFitScreen = false
4647
4748 var orientationChangeFixedPixel: FixedPixel ? = FixedPixel .CENTER
@@ -392,7 +393,7 @@ open class TouchImageView @JvmOverloads constructor(context: Context, attrs: Att
392393 setScaleType(scaleType!! )
393394 }
394395 resetZoom()
395- scaleImage(scale.toDouble(), viewWidth / 2 .toFloat(), viewHeight / 2 .toFloat(), true )
396+ scaleImage(scale.toDouble(), viewWidth / 2 .toFloat(), viewHeight / 2 .toFloat(), isSuperZoomEnabled )
396397 touchMatrix.getValues(floatMatrix)
397398 floatMatrix[Matrix .MTRANS_X ] = - (focusX * imageWidth - viewWidth * 0.5f )
398399 floatMatrix[Matrix .MTRANS_Y ] = - (focusY * imageHeight - viewHeight * 0.5f )
@@ -897,7 +898,7 @@ open class TouchImageView @JvmOverloads constructor(context: Context, attrs: Att
897898 }
898899
899900 override fun onScale (detector : ScaleGestureDetector ): Boolean {
900- scaleImage(detector.scaleFactor.toDouble(), detector.focusX, detector.focusY, true )
901+ scaleImage(detector.scaleFactor.toDouble(), detector.focusX, detector.focusY, isSuperZoomEnabled )
901902
902903 // OnTouchImageViewListener is set: TouchImageView pinch zoomed by user.
903904 touchImageViewListener?.onMove()
@@ -917,7 +918,7 @@ open class TouchImageView @JvmOverloads constructor(context: Context, attrs: Att
917918 animateToZoomBoundary = true
918919 }
919920 if (animateToZoomBoundary) {
920- val doubleTap = DoubleTapZoom (targetZoom, (viewWidth / 2 ).toFloat(), (viewHeight / 2 ).toFloat(), true )
921+ val doubleTap = DoubleTapZoom (targetZoom, (viewWidth / 2 ).toFloat(), (viewHeight / 2 ).toFloat(), isSuperZoomEnabled )
921922 compatPostOnAnimation(doubleTap)
922923 }
923924 }
0 commit comments