From 16cb90d9bc3e20e729d0dd6249945f2307be677e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E7=9A=AE?= <14840170+lao-pi123@user.noreply.gitee.com> Date: Tue, 5 Nov 2024 15:51:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=9B=B4=E6=92=AD=E9=97=B4?= =?UTF-8?q?=E5=A4=9A=E4=BA=BAPK=E6=97=B6=EF=BC=8C=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=B5=A0=E9=80=81=E7=A4=BC=E7=89=A9=E5=90=8E=EF=BC=8C=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=E5=9B=BE=E7=89=87=EF=BC=881=E3=80=812=E3=80=813?= =?UTF-8?q?=E3=80=814=EF=BC=89=E9=97=AA=E7=83=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/yunbao/common/glide/ImgLoader.java | 8 ++++++++ .../java/com/yunbao/live/views/LiveRoomViewHolder.java | 10 +++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/glide/ImgLoader.java b/common/src/main/java/com/yunbao/common/glide/ImgLoader.java index 8d034acfa..31786d223 100644 --- a/common/src/main/java/com/yunbao/common/glide/ImgLoader.java +++ b/common/src/main/java/com/yunbao/common/glide/ImgLoader.java @@ -198,6 +198,14 @@ public class ImgLoader { .skipMemoryCache(SKIP_MEMORY_CACHE) .into(imageView); } + public static void displayNew(Context context, int res, ImageView imageView) { + if (!contextIsExist(context)) { + return; + } + Glide.with(context) + .load(res) + .into(imageView); + } /** * 显示视频封面缩略图 diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index e00907d71..1eab1b5f3 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -6193,26 +6193,26 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (i == 0) { linearGrade1.setVisibility(View.VISIBLE); textPkName1.setText(userNiceName); - ImgLoader.display(mContext, resScore, imageGrade1); + ImgLoader.displayNew(mContext, resScore, imageGrade1); textGrade1.setText(String.valueOf(userScore)); } else if (i == 1) { linearGrade2.setVisibility(View.VISIBLE); textPkName2.setText(userNiceName); - ImgLoader.display(mContext, resScore, imageGrade2); + ImgLoader.displayNew(mContext, resScore, imageGrade2); textGrade2.setText(String.valueOf(userScore)); userId2 = userId; } else if (i == 2) { if (pkScores.size() == 3) { linearGrade4.setVisibility(View.VISIBLE); textPkName4.setText(userNiceName); - ImgLoader.display(mContext, resScore, imageGrade4); + ImgLoader.displayNew(mContext, resScore, imageGrade4); textGrade4.setText(String.valueOf(userScore)); userId4 = userId; } else { linearGrade3.setVisibility(View.VISIBLE); textPkName3.setText(userNiceName); - ImgLoader.display(mContext, resScore, imageGrade3); + ImgLoader.displayNew(mContext, resScore, imageGrade3); textGrade3.setText(String.valueOf(userScore)); userId3 = userId; } @@ -6220,7 +6220,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } else if (i == 3) { linearGrade4.setVisibility(View.VISIBLE); textPkName4.setText(userNiceName); - ImgLoader.display(mContext, resScore, imageGrade4); + ImgLoader.displayNew(mContext, resScore, imageGrade4); textGrade4.setText(String.valueOf(userScore)); userId4 = userId; }