From df500e2da410a2ee43ec31782f2227bf39a51572 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 23 Jan 2018 16:57:23 +0100 Subject: [PATCH] make sure the camera supports zoom before trying to zoom --- .../kotlin/com/simplemobiletools/camera/views/Preview.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt b/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt index e4f2a8be..338928ba 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/views/Preview.kt @@ -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 }