AI-generated Key Takeaways
-
ZoomSuggestionOptions.Builder
helps createZoomSuggestionOptions
instances for controlling camera zoom during barcode scanning. -
It requires a
ZoomSuggestionOptions.ZoomCallback
in its constructor to handle zoom actions. -
Developers can set the maximum supported zoom ratio using
setMaxSupportedZoomRatio()
to ensure compatibility with different camera implementations. -
The
build()
method finally creates aZoomSuggestionOptions
object based on the provided configurations.
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.