-
public class CoilA class that holds the singleton ImageLoader instance.
To get the singleton ImageLoader use Context.imageLoader (preferred) or imageLoader.
To set the singleton ImageLoader use ImageLoaderFactory (preferred) or setImageLoader.
-
-
Method Summary
Modifier and Type Method Description final static ImageLoaderimageLoader(Context context)Get the singleton ImageLoader. final static UnitsetImageLoader(ImageLoader imageLoader)Set the singleton ImageLoader. final static UnitsetImageLoader(ImageLoaderFactory factory)Set the ImageLoaderFactory that will be used to create the singleton ImageLoader. final static Unitreset()Clear the ImageLoader and ImageLoaderFactory held by this class. final static Disposableenqueue(ImageRequest request)final static ImageResultexecute(ImageRequest request)-
-
Method Detail
-
imageLoader
final static ImageLoader imageLoader(Context context)
Get the singleton ImageLoader.
-
setImageLoader
@Synchronized() final static Unit setImageLoader(ImageLoader imageLoader)
Set the singleton ImageLoader. Prefer using
setImageLoader(ImageLoaderFactory)to create the ImageLoader lazily.
-
setImageLoader
@Synchronized() final static Unit setImageLoader(ImageLoaderFactory factory)
Set the ImageLoaderFactory that will be used to create the singleton ImageLoader. The factory is guaranteed to be called at most once.
NOTE: factory will take precedence over an Application that implements ImageLoaderFactory.
-
reset
@Synchronized() final static Unit reset()
Clear the ImageLoader and ImageLoaderFactory held by this class.
This method is useful for testing and its use is discouraged in production code.
-
enqueue
@Deprecated(message = Replace with 'context.imageLoader.enqueue(request)'., replaceWith = @ReplaceWith(imports = {coil.imageLoader}, expression = request.context.imageLoader.enqueue(request)), level = DeprecationLevel.ERROR) final static Disposable enqueue(ImageRequest request)
-
execute
@Deprecated(message = Replace with 'context.imageLoader.execute(request)'., replaceWith = @ReplaceWith(imports = {coil.imageLoader}, expression = request.context.imageLoader.execute(request)), level = DeprecationLevel.ERROR) final static ImageResult execute(ImageRequest request)
-
-
-
-