本文整理了Java中com.bumptech.glide.RequestBuilder.preload
方法的一些代码示例,展示了RequestBuilder.preload
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RequestBuilder.preload
方法的具体详情如下:
包路径:com.bumptech.glide.RequestBuilder
类名称:RequestBuilder
方法名:preload
[英]Preloads the resource into the cache using Target#SIZE_ORIGINAL as the target width and height. Equivalent to calling #preload(int,int) with Target#SIZE_ORIGINAL as the width and height.
[中]使用Target#SIZE_ORIGINAL作为目标宽度和高度,将资源预加载到缓存中。相当于调用#preload(int,int),目标#SIZE_ORIGINAL作为宽度和高度。
代码示例来源:origin: bumptech/glide
/**
* 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);
}
代码示例来源:origin: alexvasilkov/GestureViews
@Override
protected void onResume() {
super.onResume();
// Warming up thumbnails cache for smoother experience
for (Painting painting : paintings) {
Glide.with(this).load(painting.thumbId).preload();
}
}
代码示例来源:origin: CarGuo/GSYVideoPlayer
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);
}
}
}
代码示例来源:origin: mozilla-tw/Rocket
/**
* 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);
}
代码示例来源:origin: jorgegil96/All-NBA
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();
}
}
}
}
代码示例来源:origin: Leeii/LeeFream
request.into(target);
else {
request.preload();
代码示例来源:origin: schaal/ocreader
requestBuilder.listener(myTarget).into(imageView);
} else {
requestBuilder.listener(myTarget).preload();
内容来源于网络,如有侵权,请联系作者删除!