I would like to create custom PreviewView for barcode with cameraX

Viewed 234

I would like to create custom PreviewView for barcode with CameraX, I don't find enough resources for custom UI with CameraX.

Which custom classes should I implement (to make Custom UI) and how should I register the UI to CameraX preview?

// create preview usecase

 val previewUseCase = Preview.Builder()
        .setTargetAspectRatio(screenAspectRatio)
        .setTargetRotation(previewView!!.display.rotation)
        .build()

//attach surfaceprovicer

 previewUseCase!!.setSurfaceProvider(previewView!!.createSurfaceProvider())

// bind

cameraProvider!!.bindToLifecycle(/* lifecycleOwner= */this, cameraSelector!!, previewUseCase)

I would like to create UI like that

0 Answers
Related