public ImageVideoGifDataLoadProvider(DataLoadProvider<ImageVideoWrapper, Bitmap> bitmapProvider, DataLoadProvider<InputStream, GifData> gifProvider) { cacheDecoder = new GifBitmapWrapperStreamResourceDecoder(new GifBitmapWrapperResourceDecoder( bitmapProvider.getSourceDecoder(), gifProvider.getCacheDecoder())); sourceDecoder = new GifBitmapWrapperResourceDecoder( bitmapProvider.getSourceDecoder(), gifProvider.getSourceDecoder()); encoder = new GifBitmapWrapperResourceEncoder(bitmapProvider.getEncoder(), gifProvider.getEncoder()); }
public FixedLoadProvider(ModelLoader<A, T> modelLoader, ResourceTranscoder<Z, R> transcoder, DataLoadProvider<T, Z> dataLoadProvider) { if (modelLoader == null) { throw new NullPointerException("ModelLoader must not be null"); } this.modelLoader = modelLoader; if (transcoder == null) { throw new NullPointerException("Transcoder must not be null"); } this.transcoder = transcoder; if (dataLoadProvider == null) { throw new NullPointerException("DataLoadProvider must not be null"); } this.dataLoadProvider = dataLoadProvider; }
@SuppressWarnings("unchecked") public <T, Z> DataLoadProvider<T, Z> get(Class<T> dataClass, Class<Z> resourceClass) { GET_KEY.set(dataClass, resourceClass); DataLoadProvider<T, Z> result = providers.get(GET_KEY); if (result == null) { result = EmptyDataLoadProvider.get(); } return result; }
@SuppressWarnings("unchecked") public static <T, Z> DataLoadProvider<T, Z> get() { return EMPTY_DATA_LOAD_PROVIDER; }
public <T, Z> void register(Class<T> dataClass, Class<Z> resourceClass, DataLoadProvider provider) { providers.put(new MultiClassKey(dataClass, resourceClass), provider); }