-
Notifications
You must be signed in to change notification settings - Fork 18
QrCodeGenerator
Alexander Zhirkevich edited this page Sep 5, 2022
·
2 revisions
Generator of the QR code image.
interface QrCodeGenerator {
fun generateQrCode(data: QrData, options: QrOptions) : Bitmap
suspend fun generateQrCodeSuspend(data: QrData, options: QrOptions) : Bitmap
}
fun generateQrCode(data: QrData, options: QrOptions) : Bitmap
Generate a QR code bitmap
suspend fun generateQrCodeSuspend(data: QrData, options: QrOptions) : Bitmap
Wrapper for generateQrCode
with cancellation support. Always performs with Dispatchers.Default
Number of threads used for code generating. More threads does not mean more performance.
enum class ThreadPolicy {
SingleThread, DoubleThread, QuadThread
}
Generator can be created using the following function:
fun QrCodeGenerator(
context: Context,
threadPolicy: ThreadPolicy = ThreadPolicy.SingleThread
)