/** * Preloads the resource into the cache using {@link Target#SIZE_ORIGINAL} as the target width and * height. Equivalent to calling {@link #preload(int, int)} with {@link Target#SIZE_ORIGINAL} as * the width and height. * * @return A {@link Target} that can be used to cancel the load via * {@link RequestManager#clear(Target)} * @see #preload(int, int) */ @NonNull public Target<TranscodeType> preload() { return preload(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL); }
@Override protected void onResume() { super.onResume(); // Warming up thumbnails cache for smoother experience for (Painting painting : paintings) { Glide.with(this).load(painting.thumbId).preload(); } }
private void startDownFrame(String url) { for (int i = 1; i <= 100; i++) { int time = i * getDuration() / 100; int width = CommonUtil.dip2px(getContext(), 150); int height = CommonUtil.dip2px(getContext(), 100); Glide.with(getContext().getApplicationContext()) .setDefaultRequestOptions( new RequestOptions() .frame(1000 * time) .override(width, height) .centerCrop()) .load(url).preload(width, height); } } }
/** * Preloads the resource into the cache using {@link Target#SIZE_ORIGINAL} as the target width and * height. Equivalent to calling {@link #preload(int, int)} with {@link Target#SIZE_ORIGINAL} as * the width and height. * * @return A {@link Target} that can be used to cancel the load via * {@link RequestManager#clear(Target)} * @see #preload(int, int) */ public Target<TranscodeType> preload() { return preload(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL); }
private void preFetchImages(List<SubmissionWrapper> submissions) { for (SubmissionWrapper submission : submissions) { Optional<Pair<Utilities.ThumbnailType, String>> thumbnailTypeUrl = Utilities.getThumbnailToShowFromCustomSubmission(submission); if (thumbnailTypeUrl.isPresent()) { Glide.with(context) .load(thumbnailTypeUrl.get().second) .preload(); } } } }
request.into(target); else { request.preload();
requestBuilder.listener(myTarget).into(imageView); } else { requestBuilder.listener(myTarget).preload();