CameraXAdapter

class CameraXAdapter(activity: Activity, previewView: ViewGroup, minimumResolution: Size, cameraErrorListener: CameraErrorListener, startWithBackCamera: Boolean = true) : CameraAdapter<CameraPreviewImage<Bitmap>>

CameraAdaptor implementation with CameraX, should be used in favor or Camera1Adapter.

Constructors

Link copied to clipboard
constructor(activity: Activity, previewView: ViewGroup, minimumResolution: Size, cameraErrorListener: CameraErrorListener, startWithBackCamera: Boolean = true)

Properties

Link copied to clipboard
open override val implementationName: String

Functions

Link copied to clipboard
open override fun bindToLifecycle(lifecycleOwner: LifecycleOwner)

Bind this camera manager to a lifecycle.

Link copied to clipboard
open override fun changeCamera()

Change to a new camera.

Link copied to clipboard
open override fun getCurrentCamera(): Int

Determine which camera is currently in use.

Link copied to clipboard

Get the stream of images from the camera. This is a hot Flow of images with a back pressure strategy DROP. Images that are not read from the flow are dropped. This flow is backed by a Channel.

Link copied to clipboard

Determine if the adapter is currently bound.

Link copied to clipboard
open override fun isTorchOn(): Boolean

Determine if the torch is currently on.

Link copied to clipboard
open override fun onStateChanged(source: LifecycleOwner, event: Lifecycle.Event)
Link copied to clipboard
open override fun setFocus(point: PointF)

Set the focus on a particular point on the screen.

Link copied to clipboard
open override fun setTorchState(on: Boolean)

Turn the camera torch on or off.

Link copied to clipboard
open override fun unbindFromLifecycle(lifecycleOwner: LifecycleOwner)

Unbind this camera from a lifecycle. This will pause the camera.

Link copied to clipboard
open override fun withFlashSupport(task: (Boolean) -> Unit)

Execute a task with flash support.

Link copied to clipboard
open override fun withSupportsMultipleCameras(task: (Boolean) -> Unit)

Determine if the device has multiple cameras.