From 8d932a09e1ecb94bbcf0c7d2d2f156a6ffec7f98 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 28 Feb 2023 15:50:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8E=E8=8B=B9=E6=9E=9C?= =?UTF-8?q?=E7=AB=AFPK=E7=BB=93=E6=9D=9F=E5=90=8E=EF=BC=8C=E5=AF=B9?= =?UTF-8?q?=E6=96=B9=E5=A4=B4=E5=83=8F=E4=BE=9D=E6=97=A7=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/event/AnchorInfoEvent.java | 10 ++++++++++ .../com/yunbao/live/views/LivePushRyViewHolder.java | 3 ++- .../com/yunbao/live/views/LiveRoomViewHolder.java | 12 ++++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/event/AnchorInfoEvent.java b/common/src/main/java/com/yunbao/common/event/AnchorInfoEvent.java index e15712cc0..f13719d78 100644 --- a/common/src/main/java/com/yunbao/common/event/AnchorInfoEvent.java +++ b/common/src/main/java/com/yunbao/common/event/AnchorInfoEvent.java @@ -44,4 +44,14 @@ public class AnchorInfoEvent { public void setClear(boolean clear) { this.clear = clear; } + + @Override + public String toString() { + return "AnchorInfoEvent{" + + "clear=" + clear + + ", id='" + id + '\'' + + ", userNiceName='" + userNiceName + '\'' + + ", avatar='" + avatar + '\'' + + '}'; + } } diff --git a/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java index ed02b4b79..bdf59890f 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java @@ -116,8 +116,9 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX //修改上面主播的头像 @Subscribe(threadMode = ThreadMode.MAIN) public void onUPAnchorInfo(AnchorInfoEvent e) { + Log.i(TAG, "onUPAnchorInfo: "+e); if (e != null) { - if (e.isClear() == false) { + if (!e.isClear()) { tv_avatarOther_name.setText(e.getUserNiceName()); ImgLoader.displayAvatar(mContext, e.getAvatar(), avatarOther); goto_room_view.setVisibility(View.VISIBLE); 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 3a323cb35..c8ca03de4 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -1,6 +1,7 @@ package com.yunbao.live.views; import static com.yunbao.live.bean.LiveChatBean.RECOMMEND_CARD_NOTIFY; +import static com.yunbao.live.views.LivePushRyViewHolder.btn_close; import android.app.Activity; import android.app.Dialog; @@ -79,6 +80,7 @@ import com.yunbao.common.bean.RewardAllModel; import com.yunbao.common.bean.StarChallengeStatusModel; import com.yunbao.common.bean.TaskModel; import com.yunbao.common.bean.UserBean; +import com.yunbao.common.event.AnchorInfoEvent; import com.yunbao.common.event.CustomFullServiceNotifyEvent; import com.yunbao.common.glide.ImgLoader; import com.yunbao.common.http.API; @@ -2086,10 +2088,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis //双人pk关闭 public void closePkTwo() { + Log.e("LiveRoomViewHolder", "closePkTwo: 隐藏PK信息" + goto_room_view.getVisibility()); mPkRankTopIcon.setVisibility(View.GONE); lt_pk_line.setVisibility(View.GONE); - livePKUserListBean = new LivePKUserListBean(); pkUid = ""; + if (btn_close != null) { + btn_close.setVisibility(View.GONE); + } + goto_room_view.setVisibility(View.GONE); + livePKUserListBean = new LivePKUserListBean(); } /** @@ -3930,6 +3937,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis new Handler(Looper.getMainLooper()).postDelayed(this::initPkRank, 300); break; case PK_TWO_END: + EventBus.getDefault().post(new AnchorInfoEvent(true, "", "", "")); closePkTwo(); break; case CUSTOM_FULL_SERVICE_NOTIFY: @@ -4061,7 +4069,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis }); - } for (int i = 0; i < pkScores.size(); i++) { @@ -4159,6 +4166,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } } }; + public void removeDetailView() { if (detailsView != null) { mRoot.removeView(detailsView);