diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/interfaces/MyPreview.kt b/app/src/main/kotlin/com/simplemobiletools/camera/interfaces/MyPreview.kt index 97e8b482..b8917310 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/interfaces/MyPreview.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/interfaces/MyPreview.kt @@ -13,8 +13,6 @@ interface MyPreview { fun setFlashlightState(state: Int) - fun setCamera(cameraId: Int): Boolean - fun getCameraState(): Int fun showChangeResolutionDialog() diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraOne.kt b/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraOne.kt index e78d78ad..8b68ed23 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraOne.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraOne.kt @@ -124,13 +124,10 @@ class PreviewCameraOne : ViewGroup, SurfaceHolder.Callback, MyPreview { } } - override fun resumeCamera() = setCamera(mCurrCameraId) - - override fun setCamera(cameraId: Int): Boolean { - mCurrCameraId = cameraId + override fun resumeCamera(): Boolean { val newCamera: Camera try { - newCamera = Camera.open(cameraId) + newCamera = Camera.open(mCurrCameraId) mCallback.setIsCameraAvailable(true) } catch (e: Exception) { mActivity!!.showErrorToast(e) @@ -204,7 +201,7 @@ class PreviewCameraOne : ViewGroup, SurfaceHolder.Callback, MyPreview { mConfig.lastUsedCamera = mCurrCameraId releaseCamera() - if (setCamera(mCurrCameraId)) { + if (resumeCamera()) { setFlashlightState(FLASH_OFF) mActivity?.updateCameraIcon(mCurrCameraId == mCameraImpl!!.getFrontCameraId()) mActivity?.toggleTimer(false) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraTwo.kt b/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraTwo.kt index 47b55f15..9d05fab4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraTwo.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraTwo.kt @@ -401,10 +401,6 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie checkFlashlight() } - override fun setCamera(cameraId: Int): Boolean { - return false - } - override fun getCameraState() = mCameraState override fun showChangeResolutionDialog() {