T - The type of the model the ModelLoaders built by
this factory can handleY - The type of data the ModelLoaders built by this
factory can load.public interface ModelLoaderFactory<T,Y>
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.
| Modifier and Type | Method and Description |
|---|---|
ModelLoader<T,Y> |
build(MultiModelLoaderFactory multiFactory)
Build a concrete ModelLoader for this model type.
|
void |
teardown()
A lifecycle method that will be called when this factory is about to replaced.
|
@NonNull ModelLoader<T,Y> build(@NonNull MultiModelLoaderFactory multiFactory)
multiFactory - A map of classes to factories that can be used to construct additional
ModelLoaders that this factory's ModelLoader may depend onModelLoadervoid teardown()