Merge pull request #378 from KryptKode/chore/update-camera-x

Update CameraX to 1.2.0-rc01
This commit is contained in:
Tibor Kaputa 2022-11-24 22:24:29 +01:00 committed by GitHub
commit c901a3f88e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -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"

View File

@ -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 {