1:修改交友房出现嘉宾会闭麦的情况
This commit is contained in:
@@ -1682,10 +1682,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
val pitList = mRoomInfoResp!!.room_info.pit_list
|
||||
if (pitList != null && !pitList.isEmpty()) {
|
||||
// pitMap.clear() // 避免数据累积
|
||||
// for (roomPitBean in pitList) {
|
||||
// pitMap[roomPitBean.pit_number] = roomPitBean
|
||||
// }
|
||||
|
||||
if (text == null) {
|
||||
return
|
||||
@@ -1708,17 +1704,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
) {
|
||||
mRoomInfoResp!!.user_info.pit_number = Integer.parseInt(toPitNumber)
|
||||
|
||||
|
||||
// if (messageEvent.text.user_id .equals(SpUtil.getUserId().toString()) && "9" == toPitNumber) {
|
||||
// if (customMusicFloatingView != null) {
|
||||
// customMusicFloatingView!!.destroy()
|
||||
// AgoraManager.getInstance(this@RoomActivity).desMusic()
|
||||
// isMusic = false
|
||||
// }
|
||||
// mBinding!!.roomTop.rl.visibility = View.GONE
|
||||
// ivSoundEffects(false)
|
||||
// }
|
||||
|
||||
if ("9" == toPitNumber && messageEvent.text.user_id.equals(SpUtil.getUserId().toString())) {
|
||||
mBinding!!.roomTop.rl.visibility = View.VISIBLE
|
||||
ivSoundEffects(true)
|
||||
@@ -1731,86 +1716,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
mBinding!!.roomTop.rl.visibility = View.GONE
|
||||
ivSoundEffects(false)
|
||||
}
|
||||
// if (TextUtils.isEmpty(fromPitNumber) || TextUtils.isEmpty(toPitNumber)) {
|
||||
// return
|
||||
// }
|
||||
////
|
||||
// if (mRoomInfoResp == null || mRoomInfoResp!!.room_info == null) {
|
||||
// LogUtils.e("Room info is null")
|
||||
// return
|
||||
// }
|
||||
////
|
||||
// val pitList = mRoomInfoResp!!.room_info.pit_list
|
||||
// if (pitList == null || pitList.isEmpty()) {
|
||||
// LogUtils.e("pit_list is null or empty")
|
||||
// return
|
||||
// }
|
||||
////
|
||||
// var fromBean: RoomPitBean? = null
|
||||
// var toBean: RoomPitBean? = null
|
||||
// val pitListCopy: MutableList<RoomPitBean> = ArrayList()
|
||||
//
|
||||
// for (bean in pitList) {
|
||||
// if (bean == null) continue
|
||||
// if (fromPitNumber == bean.pit_number) {
|
||||
// fromBean = bean
|
||||
// pitListCopy.add(bean)
|
||||
// } else if (toPitNumber == bean.pit_number) {
|
||||
// toBean = bean
|
||||
// pitListCopy.add(bean)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (fromBean == null || toBean == null) {
|
||||
// LogUtils.e("Cannot find pit number: from=$fromPitNumber, to=$toPitNumber")
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// // 交换 pit_number
|
||||
// val temp = fromBean.pit_number
|
||||
// fromBean.pit_number = toBean.pit_number
|
||||
// toBean.pit_number = temp
|
||||
//
|
||||
// // 构造新的 pitList
|
||||
// val newPitList: MutableList<RoomPitBean> = ArrayList()
|
||||
// for (bean in pitList) {
|
||||
// if (!pitListCopy.contains(bean)) {
|
||||
// newPitList.add(bean)
|
||||
// }
|
||||
// }
|
||||
// newPitList.add(fromBean)
|
||||
// newPitList.add(toBean)
|
||||
//// 排序 - 更简洁的 Kotlin 写法
|
||||
// newPitList.sortWith(compareBy {
|
||||
// try {
|
||||
// it.pit_number.toInt()
|
||||
// } catch (e: NumberFormatException) {
|
||||
// it.pit_number
|
||||
// }
|
||||
// })
|
||||
//
|
||||
// mRoomInfoResp!!.room_info.pit_list = newPitList
|
||||
//
|
||||
// // 更新当前用户 pit_number
|
||||
// if (mRoomInfoResp!!.user_info != null) {
|
||||
// val currentUserId = SpUtil.getUserId().toString()
|
||||
// val fromUserId = fromBean.user_id
|
||||
// val toUserId = toBean.user_id
|
||||
//
|
||||
// if (fromUserId != null && fromUserId == currentUserId) {
|
||||
// try {
|
||||
// mRoomInfoResp!!.user_info.pit_number = fromBean.pit_number.toInt()
|
||||
// } catch (e: NumberFormatException) {
|
||||
// LogUtils.e("Invalid pit number: " + toBean.pit_number)
|
||||
// }
|
||||
// } else if (toUserId != null && toUserId == currentUserId) {
|
||||
// try {
|
||||
// mRoomInfoResp!!.user_info.pit_number = fromBean.pit_number.toInt()
|
||||
// } catch (e: NumberFormatException) {
|
||||
// LogUtils.e("Invalid pit number: " + toBean.pit_number)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
dispatchRoomEvent(messageEvent)
|
||||
}
|
||||
@@ -3091,16 +2996,17 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
|
||||
fun setRoleType(roleType: Int, pit_number: Int) {
|
||||
val rl_voice = mBinding?.rlVoive // 注意:原拼写错误已修正 喇叭
|
||||
val rl_mic = mBinding?.rlMic//麦克风
|
||||
val rl_more = mBinding?.rlMore //PK
|
||||
val rl_misc = mBinding?.rlMisc //音乐
|
||||
val rl_voice = mBinding?.rlVoive // 喇叭
|
||||
val rl_mic = mBinding?.rlMic // 麦克风
|
||||
val rl_more = mBinding?.rlMore // PK按钮
|
||||
val rl_misc = mBinding?.rlMisc // 音乐按钮
|
||||
val rl_message = mBinding?.rlMessage // 消息按钮
|
||||
|
||||
// 默认隐藏所有按钮
|
||||
rl_voice?.visibility = View.GONE
|
||||
rl_mic?.visibility = View.GONE
|
||||
rl_more?.visibility = View.GONE
|
||||
rl_misc?.visibility = View.GONE
|
||||
rl_mic?.visibility = View.GONE
|
||||
|
||||
// 空指针保护
|
||||
if (mRoomInfoResp == null || mRoomInfoResp!!.room_info == null || mRoomInfoResp!!.user_info == null) {
|
||||
@@ -3111,83 +3017,92 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
val labelId = mRoomInfoResp!!.room_info.label_id
|
||||
val userPitNumber = mRoomInfoResp!!.user_info.pit_number
|
||||
|
||||
// 特殊房间类型处理(优先级最高)
|
||||
// 情况1: typeId = 6 时,只显示消息按钮
|
||||
if ("6" == typeId) {
|
||||
mBinding?.rlMessage?.visibility = View.GONE
|
||||
return // 全部隐藏,无需继续处理
|
||||
rl_message?.visibility = View.GONE
|
||||
return
|
||||
} else {
|
||||
mBinding?.rlMessage?.visibility = View.VISIBLE
|
||||
rl_message?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
|
||||
// 根据角色类型显示按钮
|
||||
// 情况2: 根据角色类型显示按钮
|
||||
when (roleType) {
|
||||
1, 2, 3 -> {
|
||||
// 角色类型1,2,3显示全部按钮(但受其他条件限制)
|
||||
rl_voice?.visibility = View.VISIBLE
|
||||
rl_mic?.visibility =
|
||||
if (pit_number != 0) View.VISIBLE else View.GONE
|
||||
rl_more?.visibility =
|
||||
if (pit_number == 9) View.VISIBLE else View.GONE
|
||||
|
||||
// 麦克风显示条件
|
||||
if (userPitNumber != 0) {
|
||||
rl_mic?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
// PK按钮显示条件:typeId=1且labelId=1且userPitNumber=9
|
||||
if ("1" == typeId && "1" == labelId && userPitNumber == 9) {
|
||||
rl_more?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
// 音乐按钮不显示
|
||||
rl_misc?.visibility = View.GONE
|
||||
}
|
||||
|
||||
0 -> {
|
||||
// 角色类型0显示喇叭和麦克风
|
||||
rl_voice?.visibility = View.VISIBLE
|
||||
rl_mic?.visibility =
|
||||
if (pit_number != 0) View.VISIBLE else View.GONE
|
||||
|
||||
// 麦克风显示条件
|
||||
if (userPitNumber != 0) {
|
||||
rl_mic?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
rl_misc?.visibility = View.GONE
|
||||
}
|
||||
|
||||
5 -> {
|
||||
// 角色类型5只显示喇叭
|
||||
rl_voice?.visibility = View.VISIBLE
|
||||
rl_more?.visibility = View.GONE
|
||||
rl_misc?.visibility = View.GONE
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
if (roleType != 5) {
|
||||
rl_misc?.visibility = View.GONE
|
||||
if (userPitNumber == 9) {
|
||||
rl_more?.visibility = View.VISIBLE
|
||||
else -> {
|
||||
// 其他角色类型不显示任何功能按钮
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// label_id 和 type_id 联合判断
|
||||
if (mutableListOf<String>("1").contains(typeId) && "1" == labelId) {
|
||||
rl_more?.visibility = View.VISIBLE
|
||||
rl_misc?.visibility = View.GONE
|
||||
}else{
|
||||
rl_more?.visibility = View.GONE
|
||||
rl_misc?.visibility = View.GONE
|
||||
}
|
||||
|
||||
// mic 显示逻辑
|
||||
if (userPitNumber > 0) {
|
||||
rl_mic?.visibility = View.VISIBLE
|
||||
if (CommonAppContext.getInstance().isMai) {
|
||||
switchMic(1)
|
||||
} else {
|
||||
switchMic(2)
|
||||
}
|
||||
} else {
|
||||
if (pit_number == 888) {
|
||||
// 情况3: 麦克风的特殊显示逻辑
|
||||
when {
|
||||
userPitNumber > 0 -> {
|
||||
rl_mic?.visibility = View.VISIBLE
|
||||
switchMic(2)
|
||||
} else if (pit_number == -1) {
|
||||
rl_mic?.visibility = View.VISIBLE // 原代码此处缺少 View. 前缀,已补全
|
||||
switchMic(1)
|
||||
} else {
|
||||
if (CommonAppContext.getInstance().isMai) {
|
||||
switchMic(1) // 打开麦克风
|
||||
} else {
|
||||
switchMic(2) // 关闭麦克风
|
||||
}
|
||||
}
|
||||
pit_number == 888 -> {
|
||||
rl_mic?.visibility = View.VISIBLE
|
||||
switchMic(2) // 关闭麦克风
|
||||
}
|
||||
pit_number == -1 -> {
|
||||
rl_mic?.visibility = View.VISIBLE
|
||||
switchMic(1) // 打开麦克风
|
||||
}
|
||||
else -> {
|
||||
rl_mic?.visibility = View.GONE
|
||||
switchMic(2)
|
||||
switchMic(2) // 关闭麦克风
|
||||
}
|
||||
}
|
||||
|
||||
// 情况4: 特殊typeId隐藏PK和音乐按钮
|
||||
if ("7" == typeId || "2" == typeId) {
|
||||
rl_more?.visibility = View.GONE
|
||||
rl_misc?.visibility = View.GONE
|
||||
}
|
||||
|
||||
// 最终确认:typeId不等于1的情况,都不展示PK按钮
|
||||
if ("1" != typeId) {
|
||||
rl_more?.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
fun isMute(is_mute: Int) {
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.adapter.GiftTwoDetailsFragment;
|
||||
import com.xscm.moduleutil.adapter.MyFragmentPagerAdapter;
|
||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.GiftLabelBean;
|
||||
import com.xscm.moduleutil.bean.GiftNumBean;
|
||||
import com.xscm.moduleutil.bean.GiftPackBean;
|
||||
@@ -734,12 +735,23 @@ public class RoomGiftDialogFragment extends BaseMvpDialogFragment<RewardGiftPres
|
||||
|
||||
@Override
|
||||
public void getGiftLabel(List<GiftLabelBean> giftLabelBeans) {
|
||||
if (giftLabelBeans == null) return;
|
||||
giftLabelBeanList = new ArrayList<>();
|
||||
giftLabelBeanList.addAll(giftLabelBeans);
|
||||
GiftLabelBean giftLabelBean = new GiftLabelBean();
|
||||
giftLabelBean.setId("0");
|
||||
giftLabelBean.setName("背包");
|
||||
giftLabelBeans.add(0, giftLabelBean);
|
||||
|
||||
if (SpUtil.getShelf()==1){
|
||||
for (GiftLabelBean giftLabelBean1 : giftLabelBeans){
|
||||
if (giftLabelBean1.getId().equals("2")){
|
||||
giftLabelBeans.remove(giftLabelBean1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(getChildFragmentManager(), giftLabelBeans, fragmentList, roomId));
|
||||
mBinding.viewPager.setOffscreenPageLimit(0);
|
||||
mBinding.slidingTabLayout.setViewPager(mBinding.viewPager);
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.activity.WebViewActivity;
|
||||
import com.xscm.moduleutil.base.BaseMvpDialogFragment;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.base.RoomManager;
|
||||
import com.xscm.moduleutil.bean.RelationCardBean;
|
||||
import com.xscm.moduleutil.bean.UserInfo;
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils;
|
||||
@@ -122,11 +123,24 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
@Override
|
||||
protected void initData() {
|
||||
MvpPre.getRoomUserInfo(room_id, user_id);
|
||||
if (type == 0) {
|
||||
if (type == 0 ) {
|
||||
mBinding.roomDian.setVisibility(GONE);
|
||||
} else {
|
||||
mBinding.roomDian.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (isPk){
|
||||
mBinding.roomBo.setVisibility(GONE);
|
||||
if (isNum==1){
|
||||
mBinding.imGs.setVisibility(GONE);
|
||||
}else {
|
||||
mBinding.imGs.setVisibility(VISIBLE);
|
||||
}
|
||||
} else {
|
||||
mBinding.roomBo.setVisibility(View.VISIBLE);
|
||||
mBinding.imGs.setVisibility(GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
@@ -144,6 +158,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
mBinding.roomRlGift.setOnClickListener(this::onClick);
|
||||
mBinding.roomJb.setOnClickListener(this::onClick);
|
||||
mBinding.tvZb.setOnClickListener(this::onClick);
|
||||
mBinding.imGs.setOnClickListener(this::onClick);
|
||||
|
||||
mBinding.textView1.setOnClickListener(this::onClick);
|
||||
mBinding.textView2.setOnClickListener(this::onClick);
|
||||
@@ -154,6 +169,8 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
mBinding.roomMCz.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
mBinding.moreButton.setTextColor(ColorManager.getInstance().getPrimaryColorInt());
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -234,6 +251,8 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
dianj(2);
|
||||
}else if (id==R.id.im_qml){
|
||||
MvpPre.clearUserCharm(room_id, user_id);
|
||||
}else if (id==R.id.im_gs){
|
||||
RoomManager.getInstance().fetchRoomDataAndEnter(getActivity(), room_id, "",null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -631,57 +650,12 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
break;
|
||||
}
|
||||
|
||||
if (isPk){
|
||||
mBinding.roomBo.setVisibility(GONE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// switch (type) {
|
||||
// case 1: // 房主
|
||||
// case 2: // 管理员
|
||||
// case 3: // 主持
|
||||
// if (isSelf) {
|
||||
// mBinding.roomDian.setVisibility(View.GONE);
|
||||
// mBinding.roomJb.setVisibility(View.GONE);
|
||||
// mBinding.roomLh.setVisibility(View.GONE);
|
||||
// mBinding.roomBo.setVisibility(View.GONE);
|
||||
// } else {
|
||||
// mBinding.roomDian.setVisibility(View.VISIBLE);
|
||||
// mBinding.roomJb.setVisibility(View.GONE);
|
||||
// mBinding.roomLh.setVisibility(View.GONE);
|
||||
// mBinding.roomBo.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
// break;
|
||||
// case 4: // 普通用户
|
||||
// mBinding.roomDian.setVisibility(View.GONE);
|
||||
// if (isSelf) {
|
||||
// mBinding.roomJb.setVisibility(View.GONE);
|
||||
// mBinding.roomLh.setVisibility(View.GONE);
|
||||
// mBinding.roomBo.setVisibility(View.GONE);
|
||||
// mBinding.roomMCz.setVisibility(View.VISIBLE);
|
||||
// } else {
|
||||
// mBinding.roomJb.setVisibility(View.VISIBLE);
|
||||
// mBinding.roomLh.setVisibility(View.VISIBLE);
|
||||
// mBinding.roomBo.setVisibility(View.VISIBLE);
|
||||
// mBinding.roomMCz.setVisibility(View.GONE);
|
||||
// }
|
||||
// break;
|
||||
// case 0:
|
||||
// mBinding.roomDian.setVisibility(View.GONE);
|
||||
// if (isSelf) {
|
||||
// mBinding.roomJb.setVisibility(View.GONE);
|
||||
// mBinding.roomLh.setVisibility(View.GONE);
|
||||
// mBinding.roomBo.setVisibility(View.GONE);
|
||||
// mBinding.roomMCz.setVisibility(View.VISIBLE);
|
||||
// } else {
|
||||
// mBinding.roomJb.setVisibility(View.VISIBLE);
|
||||
// mBinding.roomLh.setVisibility(View.VISIBLE);
|
||||
// mBinding.roomBo.setVisibility(View.VISIBLE);
|
||||
// mBinding.roomMCz.setVisibility(View.GONE);
|
||||
// }
|
||||
// default:
|
||||
// // 默认处理
|
||||
// break;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -511,10 +511,6 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
|
||||
String pitNumber = messageEvent.getText().getPit_number();
|
||||
int userId = fromUserInfo.getUser_id();
|
||||
// List<RoomPitBean> pitList = roomInfoResp.getRoom_info().getPit_list();
|
||||
// if (pitList != null && !pitList.isEmpty()) {
|
||||
// try {
|
||||
// RoomPitBean pitBean = pitList.get(Integer.parseInt(pitNumber) - 1);
|
||||
RoomPitBean pitBean = mWheatViews.get(Integer.parseInt(pitNumber) - 1).pitBean;
|
||||
pitBean.setUser_id(userId + "");
|
||||
pitBean.setAvatar(fromUserInfo.getAvatar());
|
||||
@@ -522,37 +518,20 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
pitBean.setSex(fromUserInfo.getSex() + "");
|
||||
pitBean.setCharm(fromUserInfo.getCharm());
|
||||
pitBean.setDress(fromUserInfo.getDress());
|
||||
// pitList.set(Integer.parseInt(pitNumber) - 1, pitBean);
|
||||
mWheatViews.get(Integer.parseInt(pitNumber) - 1).pitBean = pitBean;
|
||||
if (userId == SpUtil.getUserId() && pitNumber.equals("9")) {
|
||||
myPitNumber = 9;
|
||||
configGameOptionBtn();
|
||||
// if (getActivity() instanceof RoomActivity) {
|
||||
// ((RoomActivity) getActivity()).ivSoundEffects(true);
|
||||
// }
|
||||
}
|
||||
for (int i = 0; i < mWheatViews.size(); i++) {
|
||||
if (i == Integer.parseInt(pitNumber) - 1) {
|
||||
mWheatViews.get(i).setData(pitBean);
|
||||
break;
|
||||
|
||||
mWheatViews.get(Integer.parseInt(pitNumber) - 1).setData(pitBean);
|
||||
if (userId == SpUtil.getUserId() ) {
|
||||
myPitNumber=Integer.parseInt(pitNumber);
|
||||
if (pitNumber.equals("9")){
|
||||
configGameOptionBtn();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// } catch (NumberFormatException e) {
|
||||
// // Handle exception
|
||||
// }
|
||||
// }
|
||||
|
||||
initUserViewMap();
|
||||
}
|
||||
|
||||
public void event1004(RoomMessageEvent messageEvent) {
|
||||
String pitNumber = messageEvent.getText().getPit_number();
|
||||
// List<RoomPitBean> pitList = roomInfoResp.getRoom_info().getPit_list();
|
||||
// if (pitList != null && !pitList.isEmpty()) {
|
||||
// try {
|
||||
// RoomPitBean pitBean = pitList.get(Integer.parseInt(pitNumber) - 1);
|
||||
RoomPitBean pitBean = mWheatViews.get(Integer.parseInt(pitNumber) - 1).pitBean;
|
||||
pitBean.setUser_id("");
|
||||
pitBean.setAvatar("");
|
||||
@@ -560,24 +539,18 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
pitBean.setSex("");
|
||||
pitBean.setCharm("");
|
||||
pitBean.setDress("");
|
||||
mWheatViews.get(Integer.parseInt(pitNumber) - 1).pitBean = pitBean;
|
||||
if (pitNumber.equals("9")) {
|
||||
myPitNumber = 0;
|
||||
configGameOptionBtn();
|
||||
// if (getActivity() instanceof RoomActivity) {
|
||||
// ((RoomActivity) getActivity()).ivSoundEffects(false);
|
||||
// }
|
||||
mWheatViews.get(Integer.parseInt(pitNumber) - 1).setData(pitBean);
|
||||
if (messageEvent.getText().getFromUserInfo()==null){
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < mWheatViews.size(); i++) {
|
||||
if (i == Integer.parseInt(pitNumber) - 1) {
|
||||
mWheatViews.get(i).setData(pitBean);
|
||||
break;
|
||||
if (SpUtil.getUserId()==messageEvent.getText().getFromUserInfo().getUser_id()){
|
||||
myPitNumber = -1;
|
||||
if (pitNumber.equals("9")) {
|
||||
configGameOptionBtn();
|
||||
}
|
||||
// }
|
||||
// } catch (NumberFormatException e) {
|
||||
// // Handle exception
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
initUserViewMap();
|
||||
}
|
||||
|
||||
@@ -635,30 +608,10 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
bean.setUser_code("");
|
||||
bean.setDress_picture("");
|
||||
view.setData(bean);
|
||||
// roomInfoResp.getRoom_info().getPit_list().set(Integer.parseInt(view.pitBean.getPit_number()) - 1, bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// for (int i = 0; i < roomInfoResp.getRoom_info().getPit_list().size(); i++) {
|
||||
// RoomPitBean roomPitBean = roomInfoResp.getRoom_info().getPit_list().get(i);
|
||||
// if (roomPitBean.getPit_number().equals("7") || roomPitBean.getPit_number().equals("8")) {
|
||||
// continue;
|
||||
// }
|
||||
// if (Integer.parseInt(!roomPitBean.getPit_number().isEmpty() ? roomPitBean.getPit_number() : "0") > 10) {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// RoomFriendshipWheatView object = mWheatViews.get(Integer.parseInt(roomPitBean.getPit_number()) - 1);
|
||||
//
|
||||
// if (object != null) {
|
||||
// object.setData(roomPitBean);
|
||||
// } else {
|
||||
// continue;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// 在 initData() 方法中初始化映射关系
|
||||
@@ -716,70 +669,6 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
}
|
||||
}
|
||||
|
||||
// if (messageEvent.getText().getToUserInfos()!=null && messageEvent.getText().getToUserInfos().size()>0){
|
||||
// for (int i = 0; i < messageEvent.getText().getToUserInfos().size(); i++) {
|
||||
// UserInfo toUserInfo = messageEvent.getText().getToUserInfos().get(i);
|
||||
//
|
||||
// }
|
||||
// }else {
|
||||
//
|
||||
//
|
||||
// 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) {
|
||||
@@ -1054,29 +943,6 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
// 可以根据需要更新其他UI元素
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 清除魅力值
|
||||
*/
|
||||
public void clearCharm() {
|
||||
// 清除魅力值显示
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置座位魅力值
|
||||
*
|
||||
* @param model 用户数据模型
|
||||
*/
|
||||
public void setSeatCharmWithUser(Object model) { // 使用实际的用户模型类
|
||||
// 设置魅力值显示
|
||||
}
|
||||
|
||||
// 用户信息改变
|
||||
public void roomUserInfoDidChanged(UserInfo userInfo) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 心动数值变化
|
||||
*/
|
||||
@@ -1098,8 +964,6 @@ public class FriendshipRoomFragment extends BaseRoomFragment<FriendshipRoomPrese
|
||||
boolean isHaveMe = false;
|
||||
if (myPitNumber == 9 || myPitNumber == 10) {
|
||||
isHaveMe = true;
|
||||
} else {
|
||||
myPitNumber = -1;
|
||||
}
|
||||
|
||||
// 更新麦位显示
|
||||
|
||||
@@ -1048,7 +1048,7 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
if (isFastDoubleClick(pitBean.getUser_id(), pitBean.getPit_number())) {
|
||||
return;
|
||||
}
|
||||
RoomUserInfoFragment.show(roomInfoResp.getRoom_info().getRoom_id(), pitBean.getUser_id(), pitNumber + "", getHostUser(), true, 3, isNumberWhether(), getChildFragmentManager());
|
||||
RoomUserInfoFragment.show(roomInfoRespPk.getRoom_info().getRoom_id(), pitBean.getUser_id(), pitNumber + "", getHostUser(), true, 3, isNumberWhether(), getChildFragmentManager());
|
||||
// 点击的麦位是当前麦位
|
||||
// 可以执行相应的操作,如显示提示信息或执行其他逻辑
|
||||
}
|
||||
@@ -1257,9 +1257,18 @@ public class SingSongFragment extends BaseRoomFragment<SingSongPresenter, Fragme
|
||||
}
|
||||
|
||||
public void event1021(RoomMessageEvent message) {
|
||||
for (RoomPitBean pitBean : roomInfoResp.getRoom_info().getPit_list()) {
|
||||
pitBean.setCharm("0");
|
||||
wheatLayoutSingManager.updateSingleWheat(pitBean, Integer.parseInt(pitBean.getPit_number()));
|
||||
if (roomInfoRespPk != null || roomInfoRespPk.getPk_info() != null) {
|
||||
for (RoomPitBean pitBean : roomInfoResp.getRoom_info().getPit_list()){
|
||||
pitBean.setCharm("0");
|
||||
if (pitBean.getUser_id()!=null && !pitBean.getUser_id().isEmpty() && !pitBean.getUser_id().equals("0")) {
|
||||
wheatLayoutManager1.updateSingleCharm(pitBean, Integer.parseInt(pitBean.getPit_number()), 1);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
for (RoomPitBean pitBean : roomInfoResp.getRoom_info().getPit_list()) {
|
||||
pitBean.setCharm("0");
|
||||
wheatLayoutSingManager.updateSingleWheat(pitBean, Integer.parseInt(pitBean.getPit_number()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user