CameraControl

interface CameraControl
androidx.camera.core.CameraControl

An interface for controlling camera's zoom, focus and metering across all use cases.

Applications can retrieve the interface via CameraX.getCameraControl.

Summary

Public methods

abstract Unit

Cancels current FocusMeteringAction.

abstract Unit

Starts a focus and metering action by the FocusMeteringAction.

Public methods

cancelFocusAndMetering

abstract fun cancelFocusAndMetering(): Unit

Cancels current FocusMeteringAction.

It clears the 3A regions and update current AF mode to CONTINOUS AF (if supported). If auto-focus does not completes, it will notify the OnAutoFocusListener with isFocusLocked set to false.

startFocusAndMetering

abstract fun startFocusAndMetering(@NonNull action: FocusMeteringAction): Unit

Starts a focus and metering action by the FocusMeteringAction. The FocusMeteringAction contains the configuration of multiple 3A MeteringPoints, auto-cancel duration andOnAutoFocusListener to receive the auto-focus result. Check FocusMeteringAction for more details.

Parameters
action FocusMeteringAction: the FocusMeteringAction to be executed.