1:修改进入房间更改火热值

This commit is contained in:
2025-09-12 16:11:09 +08:00
parent a3b689c17e
commit d309c10cf7
8 changed files with 122 additions and 118 deletions

View File

@@ -1192,38 +1192,6 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
}
}
// 在子线程中处理礼物特效播放
// ThreadUtils.executeBySingle(new ThreadUtils.SimpleTask<Void>() {
// @Override
// public Void doInBackground() throws Throwable {
// // 预处理礼物数据(如果需要)
// LogUtils.d("@@@@doInBackground",Thread.currentThread().getName());
// if ("mp4".equals(mBinding.svgaGift.getFileExtension(giftInfo.getPlay_image()))) {
// mBinding.svgaGift.downloadAndPlayMp4(giftInfo.getPlay_image());
// }
// return null;
// }
//
// @Override
// public void onSuccess(Void result) {
// LogUtils.d("@@@@",Thread.currentThread().getName());
//
// // 在主线程中更新UI
//// runOnUiThread(() -> {
//// try {
//// // 使用post方法确保在下一个消息循环中执行
//// mBinding.svgaGift.post(() -> {
//// mBinding.svgaGift.setSource(giftInfo.getPlay_image(), 2);
//// });
//// } catch (Exception e) {
//// LogUtils.e("Error setting gift source: " + e.getMessage());
//// }
//// });
// }
// });
List<RoomPitBean> pitList = mRoomInfoResp.getRoom_info().getPit_list();
if (pitList == null) return;
@@ -1233,15 +1201,20 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
String typeId = mRoomInfoResp.getRoom_info().getType_id();
if ("2".equals(typeId)) {
roomFragment.handleAuctionMessageEvent(messageEvent);
return;
} else if ("1".equals(typeId) || "4".equals(typeId) || "3".equals(typeId)) {
String labelId = mRoomInfoResp.getRoom_info().getLabel_id();
if ("2".equals(labelId)) {
roomFragment.KtvFragmentEvent(messageEvent);
return;
} else if ("1".equals(labelId)) {
roomFragment.SingSongEvent(messageEvent);
return;
}
}
else if ("7".equals(typeId)) {
else if ("7".equals(typeId)) {//交友房
roomFragment.friendshipRoomFragmentEvent(messageEvent);
return;
// for (RoomPitBean roomPitBean : pitList) {
// if (roomPitBean.getUser_id().equals(toUserInfo.getUser_id() + "")) {
// roomPitBean.setCharm(toUserInfo.getCharm());
@@ -1260,12 +1233,12 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
@Subscribe(threadMode = ThreadMode.MAIN)
public void handleGiftAvatarBean(GiftAvatarBean giftAvatarBean) {
LogUtils.e("@@@@" + "EventBus2222222"+"playQueue.size()===="+playQueue.size());
if(!playQueue.isEmpty()){
String payUrl=playQueue.poll();
if(!mBinding.svgaGift.isPlaying()){
mBinding.svgaGift.setSource(payUrl, 2);
}
if(!playQueue.isEmpty()){
String payUrl=playQueue.poll();
if(!mBinding.svgaGift.isPlaying()){
mBinding.svgaGift.setSource(payUrl, 2);
}
}
}
private void handleMsgType1014(RoomMessageEvent messageEvent, RoomMessageEvent.T text) {
@@ -2956,14 +2929,14 @@ public class RoomActivity extends BaseMvpActivity<RoomPresenter, ActivityRoomBin
// // 恢复房间状态
// resumeRoomState();
// } else {
// 正常启动或从后台恢复
if (isInBackground) {
isInBackground = false;
// 从后台回到前台时调用
if (MvpPre != null && roomId != null) {
MvpPre.postRoomInfo(roomId);
}
// 正常启动或从后台恢复
if (isInBackground) {
isInBackground = false;
// 从后台回到前台时调用
if (MvpPre != null && roomId != null) {
MvpPre.postRoomInfo(roomId);
}
}
// }
// 延迟调整布局,确保视图已经完全加载

View File

@@ -387,6 +387,65 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
}
}
// TODO: 2025/9/12 更新火热值
public void event1005(RoomMessageEvent messageEvent){
RoomPitBean pitBean = mBinding.wheatView9.pitBean;
if (pitBean.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
pitBean.setCharm(messageEvent.getText().getToUserInfo().getCharm());
mBinding.wheatView9.setCharm(messageEvent.getText().getToUserInfo().getCharm());
return;
}
RoomPitBean pitBean1 = mBinding.wheatView10.pitBean;
if (pitBean1.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
pitBean1.setCharm(messageEvent.getText().getToUserInfo().getCharm());
mBinding.wheatView10.setCharm(messageEvent.getText().getToUserInfo().getCharm());
// mBinding.wheatView10.setData(pitBean1);
return;
}
RoomPitBean pitBean2 = mBinding.wheatView1.pitBean;
if (pitBean2.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
pitBean2.setCharm(messageEvent.getText().getToUserInfo().getCharm());
// mBinding.wheatView1.setData(pitBean2);
mBinding.wheatView1.setCharm(messageEvent.getText().getToUserInfo().getCharm());
return;
}
RoomPitBean pitBean3 = mBinding.wheatView2.pitBean;
if (pitBean3.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
pitBean3.setCharm(messageEvent.getText().getToUserInfo().getCharm());
// mBinding.wheatView2.setData(pitBean3);
mBinding.wheatView2.setCharm(messageEvent.getText().getToUserInfo().getCharm());
return;
}
RoomPitBean pitBean4 = mBinding.wheatView3.pitBean;
if (pitBean4.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
pitBean4.setCharm(messageEvent.getText().getToUserInfo().getCharm());
// mBinding.wheatView3.setData(pitBean4);
mBinding.wheatView3.setCharm(messageEvent.getText().getToUserInfo().getCharm());
return;
}
RoomPitBean pitBean5 = mBinding.wheatView4.pitBean;
if (pitBean5.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
pitBean5.setCharm(messageEvent.getText().getToUserInfo().getCharm());
// mBinding.wheatView4.setData(pitBean5);
mBinding.wheatView4.setCharm(messageEvent.getText().getToUserInfo().getCharm());
return;
}
RoomPitBean pitBean6 = mBinding.wheatView5.pitBean;
if (pitBean6.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
pitBean6.setCharm(messageEvent.getText().getToUserInfo().getCharm());
// mBinding.wheatView5.setData(pitBean6);
mBinding.wheatView5.setCharm(messageEvent.getText().getToUserInfo().getCharm());
return;
}
RoomPitBean pitBean7 = mBinding.wheatView6.pitBean;
if (pitBean7.getUser_id().equals(messageEvent.getText().getToUserInfo().getUser_id()+"")) {
pitBean7.setCharm(messageEvent.getText().getToUserInfo().getCharm());
// mBinding.wheatView6.setData(pitBean7);
mBinding.wheatView6.setCharm(messageEvent.getText().getToUserInfo().getCharm());
return;
}
}
public void event1058(RoomMessageEvent messageEvent) {
int type = messageEvent.getText().getType();
RoomPitBean pitBean = mBinding.wheatView9.pitBean;

View File

@@ -1017,6 +1017,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
}
}
// TODO: 2025/9/12 交友房
public void friendshipRoomFragmentEvent(RoomMessageEvent messageEvent) {
FriendshipRoomFragment friendshipRoomFragment = (FriendshipRoomFragment) getChildFragmentManager()
.findFragmentByTag(FriendshipRoomFragment.class.getSimpleName());
@@ -1029,6 +1030,9 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
case 1058:
friendshipRoomFragment.event1058(messageEvent);
break;
case 1005:
friendshipRoomFragment.event1005(messageEvent);
break;
default:
break;
}
@@ -1044,43 +1048,6 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
cabinFragment.handleMsgType1028(messageEvent);
}
}
// TODO: 2025/9/12 1058,在离线
public void handleMsgType1058(RoomMessageEvent messageEvent) {
String typeId = mRoomInfoResp.getRoom_info().getType_id();
String labelId = mRoomInfoResp.getRoom_info().getLabel_id();
if ("7".equals(typeId)) {
FriendshipRoomFragment friendshipRoomFragment = findFragmentByTag(FriendshipRoomFragment.class);
if (friendshipRoomFragment != null && friendshipRoomFragment.isAdded()) {
friendshipRoomFragment.upRoomInfo(mRoomInfoResp);
}
} else if ("2".equals(typeId)) {
RoomAuctionFragment auctionRoomFragment = findFragmentByTag(RoomAuctionFragment.class);
if (auctionRoomFragment != null && auctionRoomFragment.isAdded()) {
auctionRoomFragment.upRoomInfo(mRoomInfoResp);
}
} else if ("1".equals(typeId) || "3".equals(typeId) || "4".equals(typeId)) {
if ("2".equals(labelId)) {
RoomKtvFragment roomKtvFragment = findFragmentByTag(RoomKtvFragment.class);
if (roomKtvFragment != null && roomKtvFragment.isAdded()) {
roomKtvFragment.upRoomInfo(mRoomInfoResp);
}
} else if ("1".equals(labelId)) {
SingSongFragment singSongFragment = findFragmentByTag(SingSongFragment.class);
if (singSongFragment != null && singSongFragment.isAdded()) {
singSongFragment.upRoomInfo(mRoomInfoResp);
}
}
} else if ("6".equals(typeId)) {
RoomCabinFragment roomCabinFragment = findFragmentByTag(RoomCabinFragment.class);
if (roomCabinFragment != null && roomCabinFragment.isAdded()) {
roomCabinFragment.upRoomInfo(mRoomInfoResp);
}
}
}
// TODO: 2025/8/30 Ktv模式
public void KtvFragmentEvent(RoomMessageEvent messageEvent) {
RoomKtvFragment ktvFragment = (RoomKtvFragment) getChildFragmentManager()