Expand description
Images loaded from the network, a file or bytes the app holds, decoded off
the UI thread at the size they are drawn, as Compose apps load them with
Coil’s AsyncImage.
rememberAsyncImage gives a composable the ImageLoadState of an
ImageRequest: Loading until the image is decoded, then Ready or
Failed. All images share one ImageLoader: a memory cache bounded by
the bytes of its decoded pixels, a disk cache of downloaded files with a
size limit, and one download for every request of one image. A request
whose composables all left the composition stops its download.
The network goes through local_http_client(), so an app enables the
http-native (or web-http) feature as it does for its own requests.
Structs§
- Image
Cache Limits - How much the shared
ImageLoaderkeeps. - Image
Loader - Loads, decodes and caches images. A clone is the same loader;
image_loaderis the one everyrememberAsyncImageuses. - Image
Request - The image to load, and the largest size in pixels it is drawn at.
Enums§
- Image
Load Error - Why an image did not load.
- Image
Load State - Where a request is.
Functions§
- image_
loader - The loader every
rememberAsyncImageshares, with the default limits and its disk cache in the application’s cache folder. - remember
Async Image - Loads
requestthroughimage_loaderwhile the caller stays in the composition. The caller reads the returned state, so it recomposes when the image is ready or failed. An image the memory cache holds isReadyin the first composition.