diff --git a/app/build.gradle b/app/build.gradle index 3d086b5d..8f87a484 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -69,7 +69,7 @@ dependencies { implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.1" implementation 'androidx.window:window:1.1.0-alpha03' - def camerax_version = '1.2.0-beta01' + def camerax_version = '1.2.0-rc01' implementation "androidx.camera:camera-core:$camerax_version" implementation "androidx.camera:camera-camera2:$camerax_version" implementation "androidx.camera:camera-video:$camerax_version" diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/implementations/CameraXPreview.kt b/app/src/main/kotlin/com/simplemobiletools/camera/implementations/CameraXPreview.kt index 8146dcb7..3025b7fb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/implementations/CameraXPreview.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/implementations/CameraXPreview.kt @@ -196,8 +196,6 @@ class CameraXPreview( captureUseCase, ) } - - previewUseCase.setSurfaceProvider(previewView.surfaceProvider) preview = previewUseCase setupZoomAndFocus() setFlashlightState(config.flashlightState) @@ -215,7 +213,9 @@ class CameraXPreview( return Preview.Builder() .setTargetRotation(rotation) .setTargetResolution(resolution) - .build() + .build().apply { + setSurfaceProvider(previewView.surfaceProvider) + } } private fun getCaptureUseCase(resolution: Size, rotation: Int): UseCase {