ZoomSuggestionOptions.Builder

public static class ZoomSuggestionOptions.Builder extends Object

Builder to build out a ZoomSuggestionOptions.

Public Constructor Summary

Public Method Summary

ZoomSuggestionOptions
build()
Builds a ZoomSuggestionOptions instance.
ZoomSuggestionOptions.Builder
setMaxSupportedZoomRatio(float maxSupportedZoomRatio)
Sets the max supported zoom ratio.

Inherited Method Summary

Public Constructors

public Builder (ZoomSuggestionOptions.ZoomCallback zoomCallback)

Builder for ZoomSuggestionOptions.

Parameters
zoomCallback The ZoomSuggestionOptions.ZoomCallback to zoom the camera.

Public Methods

public ZoomSuggestionOptions build ()

Builds a ZoomSuggestionOptions instance.

public ZoomSuggestionOptions.Builder setMaxSupportedZoomRatio (float maxSupportedZoomRatio)

Sets the max supported zoom ratio.

Different camera libraries have different ways to fetch the max supported zoom ratio.

  • Camera1: camera.getZoomRatios(camera.getMaxZoom())
  • Camera2: characteristics.get(CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM)
  • CameraX: camera.getCameraInfo().getZoomState().getValue().getMaxZoomRatio()

If unset, then the library may produce an unbounded zoom ratio.

Parameters
maxSupportedZoomRatio the max supported zoom ratio fetched from camera.
Returns
  • this object, for chaining method calls.