placeholder feature? For instance if I'm creating a custom
Painter
and I want to provide a preview for that?
Example: I've a QRCode to be generated and I want to provide a preview that look like a QRCode without actually running the code to generate it
z
Zach Klippenstein (he/him) [MOD]
07/08/2021, 2:38 PM
There’s no way to magically replace the content of an arbitrary composable. I think you’d have to write a separate fake QR code composable and use that in your preview.
d
Daniele Segato
07/08/2021, 3:48 PM
I suppose Coil and any other libraries for image loading have the same problem with previews
Daniele Segato
07/08/2021, 4:06 PM
It is actually possible:
Copy code
if (LocalInspectionMode.current) {
// inspection mode (preview)
}