Has anyone tried to display a QR code using wear OS? I'm just trying to show a regular png with a QR...
s
Has anyone tried to display a QR code using wear OS? I'm just trying to show a regular png with a QR code in a sample app and I'm just seeing a white screen (I played around with the dimensions of the resource but to no avail)
a
As in, you're trying to display a PNG file (whether it has a qr code is not relevant right?) but it renders as a white space? Can you share the code?
s
Copy code
@Composable
fun Barcode(barcodeId: String){
       Icon(modifier = Modifier.fillMaxSize(), painter = painterResource(id = R.drawable.qrcode), contentDescription = "")
}
Sorry for the late response, yeah I don't think it's the qr code. Compose Wear supports showing images I think? The code looks simple enough, nothing crazy going on
j
have you made sure the background is not white? modifier = Modifier.fillMaxSize().background(Color.Black)?
s
Yes that didn't work though
Looks like there's potentially some other issues going on, I used another image from appcompat library and it worked.
y
Try Image instead of Icon.