feat: Improvements about zoom scale value and ultra-wide camera #592
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is for improvements zoom scale feature, especially for avoiding to select ultra wide camera unintentionally. Please review and merge if looks good.
New features
added
zoomScale
value notifier in MobileScannerController for the application to know the zoom scale value set actually.The value is notified from the native SDK(CameraX/AVFoundation).
added
resetZoomScale()
in MobileScannerController to reset zoom ratio with 1x.Both Android and iOS, if the device have ultra-wide camera, calling
setZoomScale
with small value causes to use ultra-wide camera and may be diffcult to detect barcodes.resetZoomScale()
is useful to use standard camera with zoom 1x.setZoomScale()
with the specific value can realize same effect, but addedresetZoomScale
for avoiding floating point errors.The application can know what zoom scale value is selected actually by subscribing
zoomScale
above after callingresetZoomScale
.Changed behaviors
(iOS only) call
resetZoomScale
while starting scan.Android camera is initialized with a zoom of 1x, whereas iOS is initialized with the minimum zoom value, which causes to select the ultra-wide camera unintentionally ([iOS] Impossible to focus and scan the QR code due to picking the wide back camera #554).
Fixed this issue by calling
resetZoomScale
(iOS only) remove zoom animation with
ramp
function to match Android behavior.