/** * Returns a {@link RequestOptions} object with {@link #signature} set. */ @NonNull @CheckResult public static RequestOptions signatureOf(@NonNull Key signature) { return new RequestOptions().signature(signature); }
SingleRequest<List> build() { RequestOptions requestOptions = new RequestOptions() .error(errorDrawable) .placeholder(placeholderDrawable) .fallback(fallbackDrawable) .override(overrideWidth, overrideHeight) .priority(priority) .signature(signature) .useUnlimitedSourceGeneratorsPool(useUnlimitedSourceGeneratorsPool); return SingleRequest.obtain( /*context=*/ glideContext, /*glideContext=*/ glideContext, model, transcodeClass, requestOptions, overrideWidth, overrideHeight, priority, target, /*targetListener=*/ null, requestListeners, requestCoordinator, engine, transitionFactory, Executors.directExecutor()); } }
new RequestOptions().decode(Float.class)) .addEqualityGroup( new RequestOptions().signature(new ObjectKey("test")), new RequestOptions().signature(new ObjectKey("test"))) .addEqualityGroup( new RequestOptions().signature(new ObjectKey("test2"))) .addEqualityGroup( new RequestOptions().theme(app.getTheme()),
/** * Returns a {@link RequestOptions} object with {@link #signature} set. */ @CheckResult public static RequestOptions signatureOf(@NonNull Key signature) { return new RequestOptions().signature(signature); }
private void setImage(){ loading_progress.setVisibility(View.GONE); Glide.with(image_frame.getContext()) .asBitmap() .load(image_or_video_path) .apply( new RequestOptions().signature(new ObjectKey(Calendar.getInstance().getTime())) .diskCacheStrategy(DiskCacheStrategy.RESOURCE) ) .into(image_frame); } public void onSaveInstanceState(Bundle outState) {
.signature(albumItem.getGlideSignature());
/** * Sets some additional data to be mixed in to the memory and disk cache keys allowing the caller * more control over when cached data is invalidated. * * <p> Note - The signature does not replace the cache key, it is purely additive. </p> * * @param signature A unique non-null {@link Key} representing the current * state of the model that will be mixed in to the cache key. * @return This request builder. * @see com.bumptech.glide.signature.ObjectKey */ @CheckResult public RequestOptions signature(@NonNull Key signature) { if (isAutoCloneEnabled) { return clone().signature(signature); } this.signature = Preconditions.checkNotNull(signature); fields |= SIGNATURE; return selfOrThrowIfLocked(); }
public RequestOptions getGlideRequestOptions(Context context) { return new RequestOptions() .diskCacheStrategy(DiskCacheStrategy.RESOURCE) .error(Util.getErrorPlaceholder(context)) .signature(getGlideSignature()); } }
.signature(albumItem.getGlideSignature());
private void download() { if (this.mRequestedImage != null) { if (this.mRequestedImage.imageUri != null) { this.mHandler.sendEmptyMessageDelayed(2, (long) this.mDownloadTimeout); this.mRequestedImage.traceTag = AppTrace.beginAsyncSection("Background image load"); this.mRequestManager.asBitmap() .load(this.mRequestedImage.imageUri) .apply(new RequestOptions() .signature(new ObjectKey(this.mRequestedImage.signature)) .diskCacheStrategy(DiskCacheStrategy.ALL) .transform(this.mBitmapTransform)) // removed context, .into(this.mTarget); return; } this.mRequestManager.clear(this.mTarget); onDownloadFinished(); } }