Class CameraScannerController

    • Constructor Detail

      • CameraScannerController

        public CameraScannerController​(ScannerFragment fragment,
                                       androidx.camera.view.PreviewView previewView,
                                       ScannerController controller)
        Creates a CameraScannerController for previewing and scanning QR codes
        Parameters:
        fragment - The fragment that uses the camera.
        previewView - The UI element in fragment to show camera preview on.
        controller - Manages QR Code scanning.
        See Also:
        ScannerController
    • Method Detail

      • setupCamera

        protected void setupCamera​(com.google.common.util.concurrent.ListenableFuture<androidx.camera.lifecycle.ProcessCameraProvider> cameraProviderFuture)
                            throws java.util.concurrent.ExecutionException,
                                   java.lang.InterruptedException
        Enables the camera to scan for QR codes using the ImageAnalysis use case
        Specified by:
        setupCamera in class CameraController
        Parameters:
        cameraProviderFuture - The camera's provider object
        Throws:
        java.util.concurrent.ExecutionException - if setup fails
        java.lang.InterruptedException - if setup fails