【发布时间】:2018-07-13 11:32:27
【问题描述】:
如何在 100% 加载原始图片之前从 Instagram 等 URL 加载图片?如何获取模糊图像并加载到 imageview 中?
我尝试了一个部门。滑翔
GlideApp.with((Activity) context)
.load(video.video_thumnail)
.centerCrop()
.transition(DrawableTransitionOptions.withCrossFade())
.skipMemoryCache(true) //No memory cache
.diskCacheStrategy(DiskCacheStrategy.NONE) //No disk cache
.listener(new RequestListener<Drawable>() {
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
return false;
}
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
mainViewHolder.imgVideoImage.setImageDrawable(resource);
return true;
}
})
.into(mainViewHolder.imgVideoImage);
【问题讨论】: