add a zoom check before trying to get zoom ratios

This commit is contained in:
tibbi 2017-10-22 09:31:11 +02:00
parent 0fb37c7c20
commit b6834e2099
1 changed files with 4 additions and 1 deletions

View File

@ -141,7 +141,10 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
mParameters = mCamera!!.parameters mParameters = mCamera!!.parameters
mMaxZoom = mParameters!!.maxZoom mMaxZoom = mParameters!!.maxZoom
mZoomRatios = mParameters!!.zoomRatios as ArrayList<Int>
if (mParameters!!.isZoomSupported)
mZoomRatios = mParameters!!.zoomRatios as ArrayList<Int>
mSupportedPreviewSizes = mParameters!!.supportedPreviewSizes.sortedByDescending { it.width * it.height } mSupportedPreviewSizes = mParameters!!.supportedPreviewSizes.sortedByDescending { it.width * it.height }
refreshPreview() refreshPreview()