Skip to content

Instantly share code, notes, and snippets.

@DUMA042
Created January 10, 2025 23:01
Show Gist options
  • Save DUMA042/56824092c884aa1ff7cc1b07d8f43b2b to your computer and use it in GitHub Desktop.
Save DUMA042/56824092c884aa1ff7cc1b07d8f43b2b to your computer and use it in GitHub Desktop.
val barcodeResults = result?.getValue(barcodeScanner)
if (!barcodeResults.isNullOrEmpty()) {
// Update the barcode state with the first detected barcode
barcode = barcodeResults.first().rawValue
// Update the state to indicate a barcode has been detected
qrCodeDetected = true
// Update the bounding rectangle of the detected barcode
boundingRect = barcodeResults.first().boundingBox
// Log the bounding box for debugging purposes
Log.d("Looking for Barcode ", barcodeResults.first().boundingBox.toString())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment