|
|
@ -143,14 +143,15 @@ public class MessageSwipeableRecyclerAdapter extends RecyclerView.Adapter<Messag |
|
|
|
//if (!TextUtils.isEmpty(item.getIsRead())&&"1".equals(item.getIsRead())) holder.badge.setVisibility(View.VISIBLE);
|
|
|
|
//if (!TextUtils.isEmpty(item.getIsRead())&&"1".equals(item.getIsRead())) holder.badge.setVisibility(View.VISIBLE);
|
|
|
|
/** 文字非空 以及 非url */ |
|
|
|
/** 文字非空 以及 非url */ |
|
|
|
if (!TextUtils.isEmpty(item.getAvatar()) && !Patterns.WEB_URL.matcher(avatarUrl).matches()) avatarUrl = BuildConfig.HOST_URL + avatarUrl.substring(1); |
|
|
|
if (!TextUtils.isEmpty(item.getAvatar()) && !Patterns.WEB_URL.matcher(avatarUrl).matches()) avatarUrl = BuildConfig.HOST_URL + avatarUrl.substring(1); |
|
|
|
Glide.with(holder.itemView.getContext()) |
|
|
|
if (holder.image.getDrawable() == null) { |
|
|
|
.load(avatarUrl) |
|
|
|
Glide.with(holder.itemView.getContext()) |
|
|
|
.skipMemoryCache(true) |
|
|
|
.load(avatarUrl) |
|
|
|
.centerCrop() |
|
|
|
.centerCrop() |
|
|
|
.override(100, 100) |
|
|
|
.override(100, 100) |
|
|
|
.placeholder(R.drawable.icon_img_loading) // 加载图片
|
|
|
|
.placeholder(R.drawable.icon_img_loading) |
|
|
|
.error(R.drawable.icon_links_avatar) // 加载错误
|
|
|
|
.error(R.drawable.icon_links_avatar) |
|
|
|
.into(holder.image); |
|
|
|
.into(holder.image); |
|
|
|
|
|
|
|
} |
|
|
|
holder.container.setOnTouchListener((view, event) -> { |
|
|
|
holder.container.setOnTouchListener((view, event) -> { |
|
|
|
onSwipeableViewContainerTouch(view, event); |
|
|
|
onSwipeableViewContainerTouch(view, event); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|