/** * 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; }
/** * An optional callback invoked when a resource load is started. * * @see Target#onLoadStarted(Drawable) * @param placeholder The placeholder drawable to optionally show, or null. */ protected void onResourceLoading(@Nullable Drawable placeholder) { // Default empty. }
/** * 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; }
/** * Returns an {@link Exception} with a stack trace that includes where the request originated * (if previously set via {@link #setOrigin(Exception)}) * * <p>This is an experimental API that may be removed in the future. */ @Nullable public Exception getOrigin() { return exception; }
/** * Notifies the callback that the load is complete. * * @param sourceKey The id of the loaded data. * @param data The loaded data, or null if the load failed. * @param fetcher The data fetcher we attempted to load from. * @param dataSource The data source we were loading from. * @param attemptedKey The key we were loading data from (may be an alternate). */ void onDataFetcherReady(Key sourceKey, @Nullable Object data, DataFetcher<?> fetcher, DataSource dataSource, Key attemptedKey);
/** * 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; } } }
/** * The method that will be called when the resource load has finished. * * @param resource the loaded resource. */ void onResourceReady(@NonNull R resource, @Nullable Transition<? super R> transition);
@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; } }
@NonNull private static String getVersionCode(@Nullable PackageInfo packageInfo) { String versionCode; if (packageInfo != null) { versionCode = String.valueOf(packageInfo.versionCode); } else { versionCode = UUID.randomUUID().toString(); } return versionCode; }
@Nullable @Override public Resource<BitmapDrawable> transcode(@NonNull Resource<Bitmap> toTranscode, @NonNull Options options) { return LazyBitmapDrawableResource.obtain(resources, toTranscode); } }