diff --git a/android/src/main/java/com/rncamerakit/CKCamera.kt b/android/src/main/java/com/rncamerakit/CKCamera.kt index efbfe8632..4009bdcc8 100644 --- a/android/src/main/java/com/rncamerakit/CKCamera.kt +++ b/android/src/main/java/com/rncamerakit/CKCamera.kt @@ -285,19 +285,20 @@ class CKCamera(context: ThemedReactContext) : FrameLayout(context), LifecycleObs // ImageCapture imageCapture = ImageCapture.Builder() - .setCaptureMode(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY) - // We request aspect ratio but no resolution to match preview config, but letting - // CameraX optimize for whatever specific resolution best fits our use cases - .setTargetAspectRatio(screenAspectRatio) - // Set initial target rotation, we will have to call this again if rotation changes - // during the lifecycle of this use case - .setTargetRotation(rotation) - .build() + .setCaptureMode(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY) + // We request aspect ratio but no resolution to match preview config, but letting + // CameraX optimize for whatever specific resolution best fits our use cases + .setTargetAspectRatio(screenAspectRatio) + // Set initial target rotation, we will have to call this again if rotation changes + // during the lifecycle of this use case + .setTargetRotation(rotation) + .build() // ImageAnalysis imageAnalyzer = ImageAnalysis.Builder() - .setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST) - .build() + .setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST) + .setTargetAspectRatio(screenAspectRatio) + .build() val useCases = mutableListOf(preview, imageCapture)