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);