Updated MainActivity to new generateEpcQrCode() signature
This commit is contained in:
parent
44f0bf7d34
commit
391bad8ade
|
@ -32,7 +32,10 @@ class MainActivity : AppCompatActivity() {
|
|||
private fun generateQrCode() {
|
||||
hideKeyboard(edtxtReference)
|
||||
|
||||
val param = EpcQrCodeConfig(edtxtReceiver.string, edtxtIban.string, edtxtBic.string, edtxtAmount.string, edtxtReference.string)
|
||||
val density = resources.displayMetrics.density
|
||||
val heightAndWidth = (350 * density).toInt()
|
||||
|
||||
val param = EpcQrCodeConfig(edtxtReceiver.string, edtxtIban.string, edtxtBic.string, edtxtAmount.string, edtxtReference.string, qrCodeHeightAndWidth = heightAndWidth)
|
||||
|
||||
generateQrCodeAsync(param) { createdQrCode ->
|
||||
imgGeneratedQrCode.setImageBitmap(createdQrCode)
|
||||
|
@ -41,10 +44,7 @@ class MainActivity : AppCompatActivity() {
|
|||
|
||||
private fun generateQrCodeAsync(param: EpcQrCodeConfig, done: (Bitmap) -> Unit) {
|
||||
GlobalScope.launch(Dispatchers.IO) {
|
||||
val density = resources.displayMetrics.density
|
||||
val heightAndWidth = (350 * density).toInt()
|
||||
|
||||
val epcQrCode = EpcQrCodeGenerator().generateEpcQrCode(param, heightAndWidth)
|
||||
val epcQrCode = EpcQrCodeGenerator().generateEpcQrCode(param)
|
||||
|
||||
withContext(Dispatchers.Main) {
|
||||
done(epcQrCode.androidBitmap)
|
||||
|
|
Loading…
Reference in New Issue