From 8a6f1ae9e833a483df1b67bcf82fb748f9c3e89c 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: Wed, 6 Nov 2024 13:36:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B4=E6=92=AD=E9=97=B4=E5=A4=9A=E4=BA=BAPK?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E7=94=A8=E6=88=B7=E8=B5=A0=E9=80=81=E7=A4=BC?= =?UTF-8?q?=E7=89=A9=E5=90=8E=EF=BC=8CPK=E6=97=B6=E9=97=B4=E5=92=8C?= =?UTF-8?q?=E5=88=86=E6=95=B0=E7=AD=89View=E9=97=AA=E7=83=81=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20=E5=9B=9E=E5=88=B0=E8=80=81=E7=89=88?= =?UTF-8?q?=E6=9C=AC=EF=BC=88=E6=9C=89=E9=97=AE=E9=A2=98=EF=BC=8C=E5=85=88?= =?UTF-8?q?=E9=97=AA=E7=83=81=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/live/views/LiveRoomViewHolder.java | 54 ++++++++----------- 1 file changed, 23 insertions(+), 31 deletions(-) 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 920c09efd..ffa8e74fa 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -6111,43 +6111,35 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void upDataPkScore(JSONArray pkScores, int time) { L.eSw("upDataPkScore(JSONArray pkScores, int time) {" + new Gson().toJson(pkScores)); isShowGif = true; - /* if (detailsView != null) { + if (detailsView != null) { mRoot.removeView(detailsView); - }*/ - - // TODO 这里可能存在问题,需要问何 - if (detailsView == null){ - L.eSw("upDataPkScore(JSONArray pkScores, int time) {detailsView=null"); - detailsView = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null); - timeTitle = detailsView.findViewById(R.id.time_title); - textTime = detailsView.findViewById(R.id.text_time); - linearGrade1 = detailsView.findViewById(R.id.lin_pk1); - linearGrade2 = detailsView.findViewById(R.id.lin_pk2); - linearGrade3 = detailsView.findViewById(R.id.lin_pk3); - linearGrade4 = detailsView.findViewById(R.id.lin_pk4); - textPkName1 = detailsView.findViewById(R.id.text_pk_name1); - textPkName2 = detailsView.findViewById(R.id.text_pk_name2); - textPkName3 = detailsView.findViewById(R.id.text_pk_name3); - textPkName4 = detailsView.findViewById(R.id.text_pk_name4); - textGrade1 = detailsView.findViewById(R.id.text_grade1); - textGrade2 = detailsView.findViewById(R.id.text_grade2); - textGrade3 = detailsView.findViewById(R.id.text_grade3); - textGrade4 = detailsView.findViewById(R.id.text_grade4); - imageGrade1 = detailsView.findViewById(R.id.image_grade1); - imageGrade2 = detailsView.findViewById(R.id.image_grade2); - imageGrade3 = detailsView.findViewById(R.id.image_grade3); - imageGrade4 = detailsView.findViewById(R.id.image_grade4); } - - if (detailsView.getParent() == null){ - L.eSw("detailsView 添加到了 mRoot"); - mRoot.addView(detailsView); - } - + L.eSw("upDataPkScore(JSONArray pkScores, int time) {detailsView=null"); + detailsView = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null); + timeTitle = detailsView.findViewById(R.id.time_title); + textTime = detailsView.findViewById(R.id.text_time); + linearGrade1 = detailsView.findViewById(R.id.lin_pk1); + linearGrade2 = detailsView.findViewById(R.id.lin_pk2); + linearGrade3 = detailsView.findViewById(R.id.lin_pk3); + linearGrade4 = detailsView.findViewById(R.id.lin_pk4); + textPkName1 = detailsView.findViewById(R.id.text_pk_name1); + textPkName2 = detailsView.findViewById(R.id.text_pk_name2); + textPkName3 = detailsView.findViewById(R.id.text_pk_name3); + textPkName4 = detailsView.findViewById(R.id.text_pk_name4); + textGrade1 = detailsView.findViewById(R.id.text_grade1); + textGrade2 = detailsView.findViewById(R.id.text_grade2); + textGrade3 = detailsView.findViewById(R.id.text_grade3); + textGrade4 = detailsView.findViewById(R.id.text_grade4); + imageGrade1 = detailsView.findViewById(R.id.image_grade1); + imageGrade2 = detailsView.findViewById(R.id.image_grade2); + imageGrade3 = detailsView.findViewById(R.id.image_grade3); + imageGrade4 = detailsView.findViewById(R.id.image_grade4); + //暂时关闭 linearGrade1.setVisibility(View.GONE); linearGrade2.setVisibility(View.GONE); linearGrade3.setVisibility(View.GONE); linearGrade4.setVisibility(View.GONE); + mRoot.addView(detailsView); mRoot.post(new Runnable() { @Override