Description
Is your feature request related to a problem? Please describe.
I'm frustrated with the current QR code scanning performance, especially when scanning small, distant, or blurry QR codes. The existing implementation lacks an auto-zoom feature, which makes it challenging to detect QR codes quickly and accurately in such conditions.
Describe the solution you'd like
I’d like to request two improvements:
1. Upgrade the ML Kit Barcode Scanning dependency to the latest version:
implementation 'com.google.mlkit:barcode-scanning:17.3.0'
This version offers performance enhancements and new features, including auto-zoom support.
1. Add Auto-Zoom functionality for QR code scanning using ZoomSuggestionOptions. This feature automatically adjusts the zoom level to improve QR code detection, especially for small or unclear codes. Here’s an example implementation:
val options = BarcodeScannerOptions.Builder()
.setBarcodeFormats(Barcode.FORMAT_QR_CODE)
.setZoomSuggestionOptions(
ZoomSuggestionOptions.Builder(zoomCallback)
.setMaxSupportedZoomRatio(maxSupportedZoomRatio)
.build()
) // Optional
.build()
Describe alternatives you've considered
- Manually adjusting the zoom level via custom camera logic, which is less efficient and doesn’t provide the smooth experience that ZoomSuggestionOptions offers.
- Using third-party libraries for QR scanning, but this adds unnecessary dependencies and complexity to the project.
Additional context
Upgrading to 17.3.0 and integrating auto-zoom will significantly improve QR code scanning accuracy and user experience. This feature is particularly useful in real-world scenarios like scanning QR codes from posters, receipts, or screens where manual zooming isn’t ideal.
Thank you for considering this feature request! 🚀