From b6834e2099203ebd82a541a681971ea5710847cd Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 22 Oct 2017 09:31:11 +0200 Subject: [PATCH] add a zoom check before trying to get zoom ratios --- app/src/main/kotlin/com/simplemobiletools/camera/Preview.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/Preview.kt b/app/src/main/kotlin/com/simplemobiletools/camera/Preview.kt index 5d5cb49e..be680bd6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/Preview.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/Preview.kt @@ -141,7 +141,10 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan mParameters = mCamera!!.parameters mMaxZoom = mParameters!!.maxZoom - mZoomRatios = mParameters!!.zoomRatios as ArrayList + + if (mParameters!!.isZoomSupported) + mZoomRatios = mParameters!!.zoomRatios as ArrayList + mSupportedPreviewSizes = mParameters!!.supportedPreviewSizes.sortedByDescending { it.width * it.height } refreshPreview()