Package 

Interface StreamCoilImageLoaderFactory

    • Method Summary

      Modifier and Type Method Description
      abstract ImageLoader imageLoader(Context context) Returns a new Coil 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.