From be0f949b19abb88ae4a3cc857e6530c3a1ad813c Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 21 Mar 2017 21:37:36 +0100 Subject: [PATCH] recheck preview size on toggling photo/video mode --- app/src/main/kotlin/com/simplemobiletools/camera/Preview.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/Preview.kt b/app/src/main/kotlin/com/simplemobiletools/camera/Preview.kt index 316d2c24..50198348 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/Preview.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/Preview.kt @@ -477,6 +477,7 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan cleanupRecorder() mIsRecording = false mIsVideoMode = false + refreshPreview() } // VIDEO RECORDING @@ -484,11 +485,8 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan if (mCamera == null || mRecorder != null || !mIsSurfaceCreated) return false + refreshPreview() mSwitchToVideoAsap = false - val preferred = mSupportedPreviewSizes!![0] - - mParameters!!.setPreviewSize(preferred.width, preferred.height) - mCamera!!.parameters = mParameters mIsRecording = false mIsVideoMode = true