fix bugs.2

This commit is contained in:
2025-12-03 17:33:30 +08:00
parent 9a4b9b973b
commit 8e9f6fa23c
5 changed files with 44 additions and 31 deletions

View File

@@ -35,6 +35,7 @@ import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
@@ -92,6 +93,7 @@ public class MessageListenerSingleton {
// 同时修改 removePublicScreenMessageListener 方法 // 同时修改 removePublicScreenMessageListener 方法
public void removePublicScreenMessageListener(PublicScreenMessageListener listener) { public void removePublicScreenMessageListener(PublicScreenMessageListener listener) {
mRoomId = "";
if (listener == null) { if (listener == null) {
return; return;
} }
@@ -203,7 +205,8 @@ public class MessageListenerSingleton {
if (TextUtils.isEmpty(roomId)) { if (TextUtils.isEmpty(roomId)) {
return; return;
} }
mRoomId = roomId; if (Objects.equals(mRoomId, roomId))
return;
synchronized (groupOperationLock) { synchronized (groupOperationLock) {
if (isGroupOperationInProgress) { if (isGroupOperationInProgress) {
// 如果有操作正在进行,延迟执行 // 如果有操作正在进行,延迟执行
@@ -214,7 +217,7 @@ public class MessageListenerSingleton {
isGroupOperationInProgress = true; isGroupOperationInProgress = true;
} }
mRoomId = roomId;
new Thread(() -> { new Thread(() -> {
try { try {
// 先退出当前群组(如果需要) // 先退出当前群组(如果需要)

View File

@@ -179,16 +179,7 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
setCardiac(pitBean.getCharm(), getTzbl()); setCardiac(pitBean.getCharm(), getTzbl());
if (bean.getUser_id() != null && !bean.getUser_id().equals("0") && !bean.getUser_id().isEmpty()) { if (bean.getUser_id() != null && !bean.getUser_id().equals("0") && !bean.getUser_id().isEmpty()) {
// if (CommonAppContext.getInstance().getOnlineMap() != null && CommonAppContext.getInstance().getOnlineMap().get(bean.getUser_id()) != null) { iv_on_line.setVisibility(pitBean.getIs_online() == 1 ? GONE : VISIBLE);
// iv_on_line.setVisibility(CommonAppContext.getInstance().getOnlineMap().get(bean.getUser_id()) == 1 ? GONE : VISIBLE);
// } else {
// iv_on_line.setVisibility(GONE);
// }
if (bean.getIs_online()== 1) {
iv_on_line.setVisibility(GONE);
}else {
iv_on_line.setVisibility(VISIBLE);
}
} else { } else {
iv_on_line.setVisibility(GONE); iv_on_line.setVisibility(GONE);
} }
@@ -429,16 +420,7 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
public void setOnlineStatus() { public void setOnlineStatus() {
if (pitBean.getUser_id() != null && !pitBean.getUser_id().equals("0") && !pitBean.getUser_id().isEmpty()) { if (pitBean.getUser_id() != null && !pitBean.getUser_id().equals("0") && !pitBean.getUser_id().isEmpty()) {
// if (CommonAppContext.getInstance().getOnlineMap() != null && CommonAppContext.getInstance().getOnlineMap().get(pitBean.getUser_id()) != null) { iv_on_line.setVisibility(pitBean.getIs_online() == 1 ? GONE : VISIBLE);
// iv_on_line.setVisibility(CommonAppContext.getInstance().getOnlineMap().get(pitBean.getUser_id()) == 1 ? GONE : VISIBLE);
// } else {
// iv_on_line.setVisibility(GONE);
// }
if(pitBean.getIs_online()==1){
iv_on_line.setVisibility(GONE);
}else {
iv_on_line.setVisibility(VISIBLE);
}
} else { } else {
iv_on_line.setVisibility(GONE); iv_on_line.setVisibility(GONE);
} }

View File

@@ -938,6 +938,9 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
case 1035: case 1035:
mentorShipFragment.event1035(messageEvent); mentorShipFragment.event1035(messageEvent);
break; break;
case 1039:
mentorShipFragment.event1039(messageEvent);
break;
case 1059: case 1059:
mentorShipFragment.event1059(messageEvent); mentorShipFragment.event1059(messageEvent);
break; break;

View File

@@ -368,14 +368,14 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
viewList[indexList.indexOf("2")].setData(pitBean) viewList[indexList.indexOf("2")].setData(pitBean)
//当前麦上出价,需要更麦上数据 //当前麦上出价,需要更麦上数据
for (i in 0 until viewList.size) { // for (i in 0 until viewList.size) {
if(i == 1 || i == 2){ // if(i == 1 || i == 2){
continue // continue
} // }
if (viewList[i].pitBean?.user_id != "0" && viewList[i].pitBean?.user_id == pitBean.user_id) { // if (viewList[i].pitBean?.user_id != "0" && viewList[i].pitBean?.user_id == pitBean.user_id) {
viewList[i].setData(mRoomInfo?.room_info?.pit_list!![indexList[i].toInt() - 1]) // viewList[i].setData(mRoomInfo?.room_info?.pit_list!![indexList[i].toInt() - 1])
} // }
} // }
if (dialogMentorShip != null && dialogMentorShip?.isShowing!!) { if (dialogMentorShip != null && dialogMentorShip?.isShowing!!) {
@@ -482,6 +482,29 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
} }
fun event1039(messageEvent: RoomMessageEvent) {
val fromId = messageEvent.text.from_pit_number
val toId = messageEvent.text.to_pit_number
if (indexList.contains(fromId)) {
val viewPos = indexList.indexOf(fromId)
val pitBean = mRoomInfo?.room_info?.pit_list!![fromId.toInt() - 1]
viewList[viewPos].setData(pitBean)
if (fromId == "1") {
mSignPitBean = pitBean
}
}
if (indexList.contains(toId)) {
val viewPos = indexList.indexOf(toId)
val pitBean = mRoomInfo?.room_info?.pit_list!![toId.toInt() - 1]
viewList[viewPos].setData(pitBean)
if (toId == "1") {
mSignPitBean = pitBean
}
}
showBtn()
}
// TODO: 清除个人魅力 // TODO: 清除个人魅力
fun event1059(messageEvent: RoomMessageEvent) { fun event1059(messageEvent: RoomMessageEvent) {
val userId: String? = messageEvent.text.user_id val userId: String? = messageEvent.text.user_id
@@ -656,4 +679,6 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
} }
} }
} }
} }

View File

@@ -427,7 +427,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
if ("is_mute_pit".equals(key)) return textMap.get("is_mute_pit"); if ("is_mute_pit".equals(key)) return textMap.get("is_mute_pit");
break; break;
case 2: case 2:
// if ("is_host".equals(key)) return textMap.get("is_host"); if ("is_host".equals(key)) return textMap.get("is_host");
if ("is_mute".equals(key)) return textMap.get("is_mute"); if ("is_mute".equals(key)) return textMap.get("is_mute");
if ("is_mute_pit".equals(key)) return textMap.get("is_mute_pit"); if ("is_mute_pit".equals(key)) return textMap.get("is_mute_pit");
break; break;