-
public interface StreamCoilImageLoaderFactoryA factory that creates new Coil ImageLoader instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classStreamCoilImageLoaderFactory.Companion
-
Method Summary
Modifier and Type Method Description abstract ImageLoaderimageLoader(Context context)Returns a new Coil ImageLoader. ImageLoaderimageLoader(Context context, List<Interceptor> interceptors)Returns a new Coil ImageLoader with the given interceptors prepended to the component registry, ahead of all decoders and Coil's built-in EngineInterceptor. -
-
Method Detail
-
imageLoader
abstract ImageLoader imageLoader(Context context)
Returns a new Coil ImageLoader.
-
imageLoader
ImageLoader imageLoader(Context context, List<Interceptor> interceptors)
Returns a new Coil ImageLoader with the given interceptors prepended to the component registry, ahead of all decoders and Coil's built-in EngineInterceptor.
The default implementation ignores interceptors and delegates to imageLoader. This means that when a custom StreamCoilImageLoaderFactory is used alongside ChatTheme's
asyncImageHeadersProvider, the async headers will not be injected — the custom factory's loader is returned as-is.Custom class implementations that want to support interceptor injection should override this method, for example by forwarding interceptors to StreamImageLoaderFactory:
override fun imageLoader(context: Context, interceptors: List<Interceptor>): ImageLoader = StreamImageLoaderFactory(interceptors = interceptors, builder = myCustomBuilder) .newImageLoader(context)Integrators using a custom StreamCoilImageLoaderFactory who also need auth headers on image requests should either override this method or inject the headers directly inside their factory's imageLoader implementation (e.g. via a custom OkHttp client).
- Parameters:
context- The Context to build the ImageLoader with.interceptors- Coil Interceptors to prepend to the component registry.
-
-
-
-