I have this code:
private fun initQRCode() {
binding?.let {
val bindingRequired = it
val helloWorld = QRCode.ofRoundedSquares()
.withColor(R.color.colorPrimaryMid)
.withSize(90)
.build("Hello world!")
val pngBytes = helloWorld.render()
val byteArr = pngBytes.getBytes()
val bmp = BitmapFactory.decodeByteArray(byteArr, 0, byteArr.size)
bindingRequired.idIVQrcode.setImageBitmap(bmp)
}
}
I try to put breakpoint on bmp and see if it generates and it does.
but on screen it stays as follow:
the xml object is:
<!--We are using this image
view to display our QR code-->
<ImageView
android:id="@+id/idIVQrcode"
android:layout_width="match_parent"
android:layout_height="110dp"
android:contentDescription="QR Code"
android:src="@color/quantum_grey"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />