/** * Internal method. */ @NonNull public RequestManagerRetriever getRequestManagerRetriever() { return requestManagerRetriever; }
/** * Returns the class of data this factory can produce * {@link com.bumptech.glide.load.data.DataRewinder}s for. */ @NonNull Class<T> getDataClass(); }
@NonNull @Override public DataSource getDataSource() { return DataSource.LOCAL; }
@NonNull @Override public Class<InputStream> getDataClass() { return InputStream.class; } }
@NonNull @Override public Class<InputStream> getDataClass() { return InputStream.class; }
@NonNull @Override public DataSource getDataSource() { return DataSource.REMOTE; } }
@NonNull @Override public Object rewindAndGet() { return data; }
/** * Writes data to the file and returns true if the write was successful and should be committed, * and false if the write should be aborted. * * @param file The File the Writer should write to. */ boolean write(@NonNull File file); }
/** * Called when the load fails. * * @param e a non-null {@link Exception} indicating why the load failed. */ void onLoadFailed(@NonNull Exception e); }
/** * Helper constructor that accepts an {@link FragmentActivity}. */ public RecyclerViewPreloader(@NonNull FragmentActivity fragmentActivity, @NonNull PreloadModelProvider<T> preloadModelProvider, @NonNull PreloadSizeProvider<T> preloadDimensionProvider, int maxPreload) { this(Glide.with(fragmentActivity), preloadModelProvider, preloadDimensionProvider, maxPreload); }
/** * Helper constructor that accepts an {@link Fragment}. */ public RecyclerViewPreloader(@NonNull Fragment fragment, @NonNull PreloadModelProvider<T> preloadModelProvider, @NonNull PreloadSizeProvider<T> preloadDimensionProvider, int maxPreload) { this(Glide.with(fragment), preloadModelProvider, preloadDimensionProvider, maxPreload); }
@NonNull private CharSequence safeSequence(@Nullable CharSequence sequence) { if (sequence == null) { return EMPTY_SEQUENCE; } else { return sequence; } } }
/** * Add bitmap to the cache with the given key. * * @param key The key to retrieve the bitmap. * @param resource The {@link com.bumptech.glide.load.engine.EngineResource} to store. * @return The old value of key (null if key is not in map). */ @Nullable Resource<?> put(@NonNull Key key, @Nullable Resource<?> resource);
/** * Registers a new {@link com.bumptech.glide.load.data.DataRewinder.Factory} to handle a * non-default data type that can be rewind to allow for efficient reads of file headers. */ @NonNull public Registry register(@NonNull DataRewinder.Factory<?> factory) { dataRewinderRegistry.register(factory); return this; }
@Override protected void onItemEvicted(@NonNull Key key, @Nullable Resource<?> item) { if (listener != null && item != null) { listener.onResourceRemoved(item); } }
@NonNull @Override public Class<Z> getResourceClass() { return resource.getResourceClass(); }
@NonNull public List<ImageHeaderParser> getImageHeaderParsers() { List<ImageHeaderParser> result = imageHeaderParserRegistry.getParsers(); if (result.isEmpty()) { throw new NoImageHeaderParserException(); } return result; }
@NonNull @Override public Class<Data> getDataClass() { return wrapped.getDataClass(); }
@Nullable @Override public LoadData<Data> buildLoadData( @NonNull WaitModel<Model> waitModel, int width, int height, @NonNull Options options) { LoadData<Data> wrappedLoadData = wrapped .buildLoadData(waitModel.wrapped, width, height, options); if (wrappedLoadData == null) { return null; } return new LoadData<>( wrappedLoadData.sourceKey, new WaitFetcher<>(wrappedLoadData.fetcher, waitModel.latch)); }