/** * Sets the current {@link com.bumptech.glide.RequestManager}. * * @param requestManager The request manager to use. */ public void setRequestManager(@Nullable RequestManager requestManager) { this.requestManager = requestManager; }
@SuppressWarnings("WeakerAccess") @Nullable public final Drawable getErrorPlaceholder() { return errorPlaceholder; }
@SuppressWarnings("WeakerAccess") @Nullable public final Drawable getPlaceholderDrawable() { return placeholderDrawable; }
@SuppressWarnings("WeakerAccess") @Nullable public final Drawable getFallbackDrawable() { return fallbackDrawable; }
/** * Constructs an instance with a shared array pool. Arrays will be reused where * possible. */ // Public API. @SuppressWarnings("WeakerAccess") public GifBitmapProvider(BitmapPool bitmapPool, @Nullable ArrayPool arrayPool) { this.bitmapPool = bitmapPool; this.arrayPool = arrayPool; }
@Override @Nullable public Request getRequest() { return request; }
@Nullable RequestManagerRetriever.RequestManagerFactory getRequestManagerFactory() { return null; } }
@Override @Nullable public synchronized Request getRequest() { return request; }
/** * Returns a reasonable default to use if no other value is set, or {@code null}. */ // Public API. @SuppressWarnings("WeakerAccess") @Nullable public T getDefaultValue() { return defaultValue; }
/** * 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);
@NonNull private CharSequence safeSequence(@Nullable CharSequence sequence) { if (sequence == null) { return EMPTY_SEQUENCE; } else { return sequence; } } }
@Nullable private File getInternalCacheDirectory() { File cacheDirectory = context.getCacheDir(); if (cacheDirectory == null) { return null; } if (diskCacheName != null) { return new File(cacheDirectory, diskCacheName); } return cacheDirectory; }
@Nullable @Override public Resource<Z> transcode(@NonNull Resource<Z> toTranscode, @NonNull Options options) { return toTranscode; } }
@Nullable @Override public Resource<BitmapDrawable> transcode(@NonNull Resource<Bitmap> toTranscode, @NonNull Options options) { return LazyBitmapDrawableResource.obtain(resources, toTranscode); } }
@Override protected void onItemEvicted(@NonNull Key key, @Nullable Resource<?> item) { if (listener != null && item != null) { listener.onResourceRemoved(item); } }
@Nullable @Override public Resource<Drawable> decode(@NonNull Drawable source, int width, int height, @NonNull Options options) { return NonOwnedDrawableResource.newInstance(source); } }
@Override public final void onLoadStarted(@Nullable Drawable placeholder) { maybeAddAttachStateListener(); onResourceLoading(placeholder); }
/** * Equivalent to calling {@link #asDrawable()} and then {@link RequestBuilder#load(File)}. * * @return A new request builder for loading a {@link Drawable} using the given model. */ @NonNull @CheckResult @Override public RequestBuilder<Drawable> load(@Nullable File file) { return asDrawable().load(file); }
/** * Equivalent to calling {@link #asDrawable()} and then {@link RequestBuilder#load(URL)}. * * @return A new request builder for loading a {@link Drawable} using the given model. */ @SuppressWarnings("deprecation") @CheckResult @Override @Deprecated public RequestBuilder<Drawable> load(@Nullable URL url) { return asDrawable().load(url); }
@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)); }