Package com.bumptech.glide.load.model
Interface ModelLoaderFactory<T,Y>
-
- Type Parameters:
T- The type of the model theModelLoaders built by this factory can handleY- The type of data theModelLoaders 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 aModelLoaderfor a given model type.The application
Contextcan be passed in to the constructor of the factory when necessary. It's unsafe to retainActivityContexts in factories. TheContextcan be obtained fromLibraryGlideModule.registerComponents(Context, Glide, Registry)in most cases.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ModelLoader<T,Y>build(MultiModelLoaderFactory multiFactory)Build a concrete ModelLoader for this model type.voidteardown()A lifecycle method that will be called when this factory is about to replaced.
-
-
-
Method Detail
-
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 additionalModelLoaders that this factory'sModelLoadermay depend on- Returns:
- A new
ModelLoader
-
teardown
void teardown()
A lifecycle method that will be called when this factory is about to replaced.
-
-