Builder

class Builder : TargetConfig.Builder<CameraX!, CameraXConfig.Builder!>
kotlin.Any
   ↳ androidx.camera.core.CameraXConfig.Builder

A builder for generating CameraXConfig objects.

Summary

Public methods

CameraXConfig

Builds an immutable CameraXConfig from the current state.

static CameraXConfig.Builder
fromConfig(@NonNull configuration: CameraXConfig)

Generates a Builder from another CameraXConfig object

CameraXConfig.Builder
setCameraExecutor(@NonNull executor: Executor)

Sets an executor which CameraX will use to initialize and shutdown.

Public methods

build

@NonNull fun build(): CameraXConfig

Builds an immutable CameraXConfig from the current state.

Return
CameraXConfig: A CameraXConfig populated with the current state.

fromConfig

@NonNull static fun fromConfig(@NonNull configuration: CameraXConfig): CameraXConfig.Builder

Generates a Builder from another CameraXConfig object

Parameters
configuration CameraXConfig: An immutable configuration to pre-populate this builder.
Return
CameraXConfig.Builder: The new Builder.

setCameraExecutor

@NonNull fun setCameraExecutor(@NonNull executor: Executor): CameraXConfig.Builder

Sets an executor which CameraX will use to initialize and shutdown.

It is not necessary to set an executor for normal use. If not set, CameraX will create and use a default internal executor.