From 21473b1d69cefe8e3b2e933e98e52f07cc1776ff Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Wed, 1 Nov 2023 16:05:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=B2=E7=BB=8F=E8=BF=9E?= =?UTF-8?q?=E9=BA=A6=E5=88=97=E8=A1=A8=E6=97=A0=E5=90=8D=E7=A7=B0=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E4=BF=AE=E6=94=B9=E8=BF=9E=E9=BA=A6=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E8=A6=86=E7=9B=96=E9=97=AE=E9=A2=98=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B8=BB=E6=92=AD=E5=85=B3=E6=92=AD=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E8=BF=9E=E9=BA=A6=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yunbao/common/manager/MicUserManager.java | 37 ++++++++++++------- .../live/activity/LiveRyAnchorActivity.java | 1 + .../live/views/LivePlayRyViewHolder.java | 3 ++ 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/manager/MicUserManager.java b/common/src/main/java/com/yunbao/common/manager/MicUserManager.java index 1df287e32..df7209ca5 100644 --- a/common/src/main/java/com/yunbao/common/manager/MicUserManager.java +++ b/common/src/main/java/com/yunbao/common/manager/MicUserManager.java @@ -32,23 +32,32 @@ public class MicUserManager extends BaseCacheManager { } public void upDataMicUser(JSONObject map) { - UserBean userModel = new UserBean(); + boolean isHave = false; + for (int i = 0; i < micUsers.size(); i++) { + if (TextUtils.equals(micUsers.get(i).getId(), map.getString("uid"))) { + isHave = true; + } + } + if (!isHave){ + UserBean userModel = new UserBean(); - UserBean.DressBean dressAvatar = null; - if (!TextUtils.isEmpty(map.getString("dress_avatar"))) { - dressAvatar = new UserBean.DressBean(); - dressAvatar.setAvatar_frame(map.getString("dress_avatar")); + UserBean.DressBean dressAvatar = null; + if (!TextUtils.isEmpty(map.getString("dress_avatar"))) { + dressAvatar = new UserBean.DressBean(); + dressAvatar.setAvatar_frame(map.getString("dress_avatar")); + } + + userModel.setAvatar(map.getString("avatar")); + userModel.setId(map.getString("uid")); + userModel.setUserNiceName(map.getString("uname")); + userModel.setDress(dressAvatar); + userModel.setSex(map.getIntValue("sex")); + userModel.setLevel(map.getIntValue("level")); + userModel.setTypeMic(2); + micUsers.add(userModel); + put(micKey, micUsers); } - userModel.setAvatar(map.getString("avatar")); - userModel.setId(map.getString("uid")); - userModel.setUserNiceName(map.getString("uname")); - userModel.setDress(dressAvatar); - userModel.setSex(map.getIntValue("sex")); - userModel.setLevel(map.getIntValue("level")); - userModel.setTypeMic(2); - micUsers.add(userModel); - put(micKey, micUsers); } public List getMicUserList() { diff --git a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java index b626f6e85..deba72dd4 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveRyAnchorActivity.java @@ -874,6 +874,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl DialogUitl.showSimpleDialog(mContext, mContext.getString(R.string.live_end_live), new DialogUitl.SimpleCallback() { @Override public void onConfirmClick(Dialog dialog, String content) { + MicStatusManager.getInstance().closeMic(mContext); MicedUserManager.get().removeAllMicUserList(); MicUserManager.get().removeAllMicUserList(); PKing = false; diff --git a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java index 4068cb0a3..02e465646 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePlayRyViewHolder.java @@ -679,6 +679,7 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { mVideoView.requestLayout(); } + @Subscribe(threadMode = ThreadMode.MAIN) public void onUpdata(String str) { if ("UsertoRY".equals(str)) { @@ -686,8 +687,10 @@ public class LivePlayRyViewHolder extends LiveRoomPlayViewHolder { @Override public void onConfirmClick(Dialog dialog, String content) { UsertoRY(); + dialog = null; } }); + } else if ("inviteMic".equals(str)) { String content = "邀請您進行語音連麥"; String confirm = "接受";