compose-desktop-imageloader
A simple, crude image loader that supports memory and disk LRU caching. Only supported Compose Desktop, because there are some more powerful image loader lib for Android platform.
Screenshot
Usage
ImageAsyncImageUrl(imageUrl,
imageCallback = ImageCallback {
Image(modifier = Modifier.size(640.dp), painter = it, contentDescription = "123")
})
ImageRes("compose-logo.png",
imageCallback = ImageCallback {
Image(modifier = Modifier.size(64.dp), painter = it, contentDescription = "res")
})
ImageAsyncSvgUrl("https://raw.githubusercontent.com/JetBrains/compose-jb/master/artwork/compose-logo.svg",
density = LocalDensity.current,
imageCallback = ImageCallback {
Image(modifier = Modifier.size(64.dp), painter = it, contentDescription = "svg")
})
ImageAsyncVectorUrl("https://raw.githubusercontent.com/JetBrains/compose-jb/master/artwork/compose-logo.xml",
density = LocalDensity.current,
imageCallback = ImageCallback {
Image(modifier = Modifier.size(64.dp), painter = it, contentDescription = "vector")
})
Download
Thanks
- https://github.com/K1rakishou/Caching-Image-Loader
- https://github.com/MayakaApps/KotlinizedLruCache
- https://github.com/JakeWharton/DiskLruCache