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 = "接受";