From b0ba5027955f2b1ffd6f9a922638804844d71d4a Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 4 Jun 2018 23:09:29 +0200 Subject: [PATCH] hide the Flashlight toggle button if no flash is available --- .../com/simplemobiletools/camera/views/PreviewCameraTwo.kt | 2 ++ 1 file changed, 2 insertions(+) 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 8b73465a..072ae30e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraTwo.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/views/PreviewCameraTwo.kt @@ -258,6 +258,8 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie mIsFlashSupported = characteristics.get(CameraCharacteristics.FLASH_INFO_AVAILABLE) ?: false mIsZoomSupported = characteristics.get(CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM) ?: 0f > 0f mIsFocusSupported = characteristics.get(CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES).size > 1 + + mActivity.setFlashAvailable(mIsFlashSupported) mCameraId = cameraId return }