From 11c9a530282f1d924940a3d1fca1e621eb52c664 Mon Sep 17 00:00:00 2001 From: Martin <13046765170@163.com> Date: Sat, 1 Jun 2024 10:16:31 +0800 Subject: [PATCH] =?UTF-8?q?fix[=E5=A3=B0=E6=9C=9B=E5=8D=87=E7=BA=A7-?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DBUG]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/live/activity/LiveSwAnchorActivity.java | 2 +- .../live/presenter/LiveSwLinkMicPkPresenter.java | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java index b9e1fe394..78c9dbf64 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveSwAnchorActivity.java @@ -1668,7 +1668,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl case LEAVE_PK_SCORE: if (mLiveSwLinkMicPkPresenter != null) { mLiveSwLinkMicPkPresenter.closeButtonGone(); - mLiveSwLinkMicPkPresenter.upDataPkScore(event.getPkScores(), event.getUid(), event.getTime()); + mLiveSwLinkMicPkPresenter.upDataPkScore(event.getPkScores(), event.getUid(), event.getTime(),true); } if (mLiveRoomViewHolder != null) { mLiveRoomViewHolder.seisShowGif(true); diff --git a/live/src/main/java/com/yunbao/live/presenter/LiveSwLinkMicPkPresenter.java b/live/src/main/java/com/yunbao/live/presenter/LiveSwLinkMicPkPresenter.java index 427d5384e..10b4c19fe 100644 --- a/live/src/main/java/com/yunbao/live/presenter/LiveSwLinkMicPkPresenter.java +++ b/live/src/main/java/com/yunbao/live/presenter/LiveSwLinkMicPkPresenter.java @@ -79,8 +79,10 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.Timer; import java.util.TimerTask; @@ -563,7 +565,7 @@ public class LiveSwLinkMicPkPresenter implements View.OnClickListener { } } pkScores.remove(removeUid); - upDataPkScore(pkScores,"-1",0); + upDataPkScore(pkScores,"-1",0,false); } }, 1000); } @@ -588,7 +590,7 @@ public class LiveSwLinkMicPkPresenter implements View.OnClickListener { if (livePushSwViewHolder != null) { livePushSwViewHolder.setAnDrPkRtc(String.valueOf(u.getId()), -1); } - final SocketSendBean msg1 = new SocketSendBean().param("_method_", SOCKET_LIVE_DRPK).param("action", 3).param("uname", CommonAppConfig.getInstance().getUserBean().getUserNiceName()).param("pkuid", CommonAppConfig.getInstance().getUid()).param("type", 3).param("uid", u.getId()).param("pkhead", CommonAppConfig.getInstance().getUserBean().getAvatar()).param("pkname", CommonAppConfig.getInstance().getUserBean().getUserNiceName()); + final SocketSendBean msg1 = new SocketSendBean().param("_method_", SOCKET_LIVE_DRPK).param("action", 3).param("uname", CommonAppConfig.getInstance().getUserBean().getUserNiceName()).param("pkuid", CommonAppConfig.getInstance().getUid()).param("msgtype", 3).param("uid", u.getId()).param("pkhead", CommonAppConfig.getInstance().getUserBean().getAvatar()).param("pkname", CommonAppConfig.getInstance().getUserBean().getUserNiceName()); msg1.create(); String targetId = "g" + CommonAppConfig.getInstance().getUid(); @@ -1063,7 +1065,7 @@ public class LiveSwLinkMicPkPresenter implements View.OnClickListener { } if (!CommonAppConfig.getInstance().getUid().equals(String.valueOf(drPkbeans.get(i).getId()))) { - final SocketSendBean msg1 = new SocketSendBean().param("_method_", SOCKET_LIVE_DRPK).param("action", 3).param("uname", CommonAppConfig.getInstance().getUserBean().getUserNiceName()).param("pkuid", CommonAppConfig.getInstance().getUid()).param("msgtype", 3).param("uid", drPkbeans.get(i).getId()).param("pkhead", CommonAppConfig.getInstance().getUserBean().getAvatar()).param("pkname", CommonAppConfig.getInstance().getUserBean().getUserNiceName()); + final SocketSendBean msg1 = new SocketSendBean().param("_method_", SOCKET_LIVE_DRPK).param("action", 3).param("uname", CommonAppConfig.getInstance().getUserBean().getUserNiceName()).param("msgtype", 3).param("uid", drPkbeans.get(i).getId()).param("pkhead", CommonAppConfig.getInstance().getUserBean().getAvatar()).param("pkname", CommonAppConfig.getInstance().getUserBean().getUserNiceName() );; msg1.create(); L.eSw("發送給自己直播間" + drPkbeans.get(i).getId()); String targetId = "g" + CommonAppConfig.getInstance().getUid(); @@ -1699,14 +1701,14 @@ public class LiveSwLinkMicPkPresenter implements View.OnClickListener { /** * 更新Pk分数 */ - public void upDataPkScore(JSONArray pkScores, String uid, int time) { + public void upDataPkScore(JSONArray pkScores, String uid, int time,boolean isShowTimeTitle) { this.pkScores = pkScores; L.eSw("更新Pk分数 upDataPkScore time:" + time + " " + pkScores); String userID1 = (String) imageGrade1.getTag(); String userID2 = (String) imageGrade2.getTag(); String userID4 = (String) imageGrade4.getTag(); - if (livePushSwViewHolder.timeTitle.getVisibility() == View.GONE &&!"-1".equals(uid)) { + if (livePushSwViewHolder.timeTitle.getVisibility() == View.GONE &&isShowTimeTitle) { mHandler.removeMessages(WHAT_PK_TIME2); RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) livePushSwViewHolder.timeTitle.getLayoutParams(); layoutParams.topMargin = DpUtil.dp2px(123);