-
Notifications
You must be signed in to change notification settings - Fork 192
Open
Labels
Description
suspend fun decodeFrom3rd(targetBmp: Bitmap): String? = suspendCancellableCoroutine { continuation ->
BarcodeDecoder.process(targetBmp, Barcode.FORMAT_QR_CODE).addOnSuccessListener {
if (it.isNotEmpty()) {
continuation.resumeWith(Result.success(it.firstOrNull()?.rawValue))
} else {
continuation.resumeWithException(Resources.NotFoundException("No QR code found"))
}
}
}