make sure the camera supports zoom before trying to zoom

This commit is contained in:
tibbi 2018-01-23 16:57:23 +01:00
parent 16d6d2044d
commit df500e2da4
1 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package com.simplemobiletools.camera.views
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Point
import android.graphics.Rect
@ -68,6 +69,7 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
constructor(context: Context) : super(context)
@SuppressLint("ClickableViewAccessibility")
constructor(activity: MainActivity, surfaceView: SurfaceView, previewListener: PreviewListener) : super(activity) {
mActivity = activity
mCallback = previewListener
@ -88,8 +90,9 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
mLastClickX = event.x.toInt()
mLastClickY = event.y.toInt()
if (mMaxZoom > 0)
if (mMaxZoom > 0 && mParameters?.isZoomSupported == true) {
mScaleGestureDetector!!.onTouchEvent(event)
}
false
}