-
-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Describe the bug
In Version 4.4.0 and up of this library, showing a created QR code in an AlertDialog will make it not bright anymore. It seems like there is some layer put on top of it. This was not the case with version 4.3.0 and below. The issue seems not to be present on Android. I tested displaying the QR code both with Coils AsyncImage and Skia's Image Composable. In both cases, the issue arises.
To Reproduce
minimal example showing the bug with version 4.4.0 and up:
import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.toComposeImageBitmap
import org.jetbrains.skia.Image
import qrcode.QRCode
@composable
fun App() {
AlertDialog(
confirmButton = { Text("Close", Modifier.clickable {}) },
onDismissRequest = { },
text = {
val qrCode = QRCode.ofSquares().withSize(25).build("Test").render().getBytes()
val bitmap = Image.makeFromEncoded(qrCode).toComposeImageBitmap()
Image(
bitmap = bitmap,
contentDescription = null,
)
}
)
}
Expected behavior
the qr code should be shown with its normal colors
Screenshots or other QRCodes rendered with other tools
Additional context

