修复直播间多人PK时,用户赠送礼物后,PK时间和分数等View闪烁的问题

This commit is contained in:
老皮 2024-11-05 15:38:25 +08:00
parent b6a5fbf313
commit 9984adfb8e

View File

@ -6111,36 +6111,38 @@ 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);
}*/
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);
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
public void run() {
@ -6224,7 +6226,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
}
textPkName2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -6245,6 +6246,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
});
}
public void upDataPkScore(JSONArray pkScores) {
L.eSw("upDataPkScore(JSONArray pkScores, int time) {" + new Gson().toJson(pkScores));
isShowGif = true;
@ -6360,7 +6362,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
}
}
textPkName2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -6381,7 +6382,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
});
}
public void removeDetailView() {
if (detailsView != null) {