I use Coil to load .svg resources from the web, for example:
@Composable
fun Widget(modifier: Modifier = Modifier) {
AsyncImage(
modifier = Modifier.fillMaxSize(),
model = ImageRequest.Builder(LocalContext.current)
.decoderFactory(SvgDecoder.Factory())
.data("https://www.svgrepo.com/show/326168/circle-large.svg")
.build(),
contentDescription = null,
contentScale = ContentScale.FillWidth
)
}
It loads successfully when running on devices, but when running in Compose Preview, no resources is displayed. How to have Compose Preview load and display resources fetched from the Web?