Interface ModelLoaderFactory<T,Y>

Type Parameters:
T - The type of the model the ModelLoaders built by this factory can handle
Y - The type of data the ModelLoaders built by this factory can load.
All Known Implementing Classes:
AssetUriLoader.FileDescriptorFactory, AssetUriLoader.StreamFactory, ByteArrayLoader.ByteBufferFactory, ByteArrayLoader.StreamFactory, ByteBufferFileLoader.Factory, DataUrlLoader.StreamFactory, FileLoader.Factory, FileLoader.FileDescriptorFactory, FileLoader.StreamFactory, HttpGlideUrlLoader.Factory, HttpUriLoader.Factory, MediaStoreFileLoader.Factory, MediaStoreImageThumbLoader.Factory, MediaStoreVideoThumbLoader.Factory, QMediaStoreUriLoader.FileDescriptorFactory, QMediaStoreUriLoader.InputStreamFactory, ResourceLoader.AssetFileDescriptorFactory, ResourceLoader.FileDescriptorFactory, ResourceLoader.StreamFactory, ResourceLoader.UriFactory, StringLoader.AssetFileDescriptorFactory, StringLoader.FileDescriptorFactory, StringLoader.StreamFactory, UnitModelLoader.Factory, UriLoader.AssetFileDescriptorFactory, UriLoader.FileDescriptorFactory, UriLoader.StreamFactory, UrlLoader.StreamFactory, UrlUriLoader.StreamFactory

public interface ModelLoaderFactory<T,Y>
An interface for creating a ModelLoader for a given model type.

The application Context can be passed in to the constructor of the factory when necessary. It's unsafe to retain Activity Contexts in factories. The Context can be obtained from LibraryGlideModule.registerComponents(Context, Glide, Registry) in most cases.

  • Method Summary

    Modifier and Type
    Method
    Description
    Build a concrete ModelLoader for this model type.
    void
    A lifecycle method that will be called when this factory is about to replaced.
  • Method Details

    • build

      @NonNull ModelLoader<T,Y> build(@NonNull MultiModelLoaderFactory multiFactory)
      Build a concrete ModelLoader for this model type.
      Parameters:
      multiFactory - A map of classes to factories that can be used to construct additional ModelLoaders that this factory's ModelLoader may depend on
      Returns:
      A new ModelLoader
    • teardown

      void teardown()
      A lifecycle method that will be called when this factory is about to replaced.