-
@Deprecated(message = LocalImageLoader was intended to provide a method to overwrite the singleton ImageLoader in local compositions. In practice, it's not clear that `LocalImageLoader.provide` **does not** set the singleton ImageLoader. This can result in accidentally creating multiple ImageLoader instances if you use a combination of `LocalImageLoader.current` and `context.imageLoader`. To maximize performance, apps should create one ImageLoader or use `ImageLoader.newBuilder` to create new ImageLoaders that share the same resources. Additionally, as a composition is at most scoped to an Activity, `LocalImageLoader.provide` encourages creating multiple ImageLoaders if the user creates multiple activities that use Compose. You should migrate to `ImageLoaderFactory` to set the singleton ImageLoader and `LocalContext.current.imageLoader` to access the singleton ImageLoader in Compose. If you need to use a locally scoped ImageLoader it's recommended to use the `AsyncImage` and `rememberAsyncImagePainter` overloads that have an ImageLoader argument and pass the local ImageLoader as input.) public final class ImageLoaderProvidableCompositionLocal
-
-
Field Summary
Fields Modifier and Type Field Description private final ImageLoadercurrent
-
Method Summary
Modifier and Type Method Description final ImageLoadergetCurrent()final ProvidedValue<ImageLoader>provides(ImageLoader value)-
-
Method Detail
-
getCurrent
@Composable()@ReadOnlyComposable() final ImageLoader getCurrent()
-
provides
final ProvidedValue<ImageLoader> provides(ImageLoader value)
-
-
-
-