Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implemented AutoZoom feature for Android #1243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sartajroshan
Copy link

#905

Summary

This PR introduces the Auto-Zoom feature to the mobile_scanner package on Android. The feature leverages ZoomSuggestionOptions from ML Kit to dynamically adjust the camera zoom level based on barcode detection, improving scanning accuracy and ease of use.

Key Changes

  • Dynamically adjusts the camera's zoom level while respecting the device's maximum zoom capabilities.
  • Introduced a new optional parameter, enableAutoZoom, in MobileScannerController for developers to control the feature.
  • The default value for enableAutoZoom is false, ensuring no change in behavior for existing implementations unless explicitly enabled.

Usage

Developers can enable or disable the Auto-Zoom feature when creating a MobileScannerController. By default, the feature is disabled.

// Enable Auto-Zoom
final MobileScannerController controller = MobileScannerController(
  enableAutoZoom: true, // Enables dynamic zoom adjustment
);

// Disable Auto-Zoom (default behavior)
final MobileScannerController controller = MobileScannerController(
  enableAutoZoom: false, // Keeps zoom at the default level
);

@sartajroshan sartajroshan changed the title Implemented AutoZoom feature for Android feat: Implemented AutoZoom feature for Android Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant