public void loadRoundImage(final Context context, String imgPath, final ImageView imageView, int placeholderResId, int failedResId) {
if (context == null) {
return;
}
Context appContext = context.getApplicationContext();
Glide.with(appContext).
load(imgPath)
.asBitmap()
.placeholder(placeholderResId)
.error(failedResId)
.centerCrop()
.into(new BitmapImageViewTarget(imageView) {
@Override
protected void setResource(Bitmap resource) {
RoundedBitmapDrawable circularBitmapDrawable =
RoundedBitmapDrawableFactory.create(context.getResources(), resource);
circularBitmapDrawable.setCircular(true);
imageView.setImageDrawable(circularBitmapDrawable);
}
});
}
GlideImageLoader.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:Hotspot-master-devp
作者:
评论列表
文章目录