|
|
@@ -91,42 +91,59 @@ class DispatchCenterSeatsTemplate :
|
|
|
val onMicIndex = roomService.seatController.getMicSeatIndex(ProfileModule.getMyUid())
|
|
|
val isMicEmpty = seatView.micSeatInfo == null || seatView.micSeatInfo?.isSeatEmpty() == true
|
|
|
|
|
|
- val actionList = mutableListOf<Pair<Int, String>>()
|
|
|
if (isOnMic) {
|
|
|
//麦上
|
|
|
if (onMicIndex == MIC_HOST) {
|
|
|
//"我"是否是主持人/管理员
|
|
|
if (isMicEmpty) {
|
|
|
//操作空麦位
|
|
|
- if (isLock) {
|
|
|
- actionList.add(Pair(R.id.id_mic_operate_unlock, getCompatString(R.string.room_mic_operate_unlock)))
|
|
|
- } else {
|
|
|
- actionList.add(Pair(R.id.id_mic_operate_invite, getCompatString(R.string.room_mic_operate_invite)))
|
|
|
- actionList.add(Pair(R.id.id_mic_operate_lock, getCompatString(R.string.room_mic_operate_lock)))
|
|
|
- }
|
|
|
+ showMicActionList(seatView, mutableListOf<Pair<Int, String>>().apply {
|
|
|
+ if (isLock) {
|
|
|
+ add(Pair(R.id.id_mic_operate_unlock, getCompatString(R.string.room_mic_operate_unlock)))
|
|
|
+ } else {
|
|
|
+ add(Pair(R.id.id_mic_operate_invite, getCompatString(R.string.room_mic_operate_invite)))
|
|
|
+ add(Pair(R.id.id_mic_operate_lock, getCompatString(R.string.room_mic_operate_lock)))
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
} else if (seatView.micIndex.index == onMicIndex) {
|
|
|
//操作自己的麦位
|
|
|
- actionList.add(Pair(R.id.id_mic_operate_member_info, getCompatString(R.string.room_mic_operate_member_info)))
|
|
|
- actionList.add(Pair(R.id.id_mic_operate_off, getCompatString(R.string.room_mic_operate_off)))
|
|
|
+ showMicActionList(seatView, mutableListOf<Pair<Int, String>>().apply {
|
|
|
+ add(Pair(R.id.id_mic_operate_member_info, getCompatString(R.string.room_mic_operate_member_info)))
|
|
|
+ add(Pair(R.id.id_mic_operate_off, getCompatString(R.string.room_mic_operate_off)))
|
|
|
+ })
|
|
|
|
|
|
} else {
|
|
|
//操作他人麦位
|
|
|
- actionList.add(Pair(R.id.id_mic_operate_member_info, getCompatString(R.string.room_mic_operate_member_info)))
|
|
|
- actionList.add(Pair(R.id.id_mic_operate_kick, getCompatString(R.string.room_mic_operate_kick)))
|
|
|
- actionList.add(Pair(R.id.id_mic_operate_lock, getCompatString(R.string.room_mic_operate_lock)))
|
|
|
- if (seatView.micSeatInfo?.isRemoteMute() == true) {
|
|
|
- actionList.add(Pair(R.id.id_mic_operate_un_mute, getCompatString(R.string.room_mic_operate_un_mute)))
|
|
|
- } else {
|
|
|
- actionList.add(Pair(R.id.id_mic_operate_mute, getCompatString(R.string.room_mic_operate_mute)))
|
|
|
- }
|
|
|
+ showMicActionList(seatView, mutableListOf<Pair<Int, String>>().apply {
|
|
|
+ add(Pair(R.id.id_mic_operate_member_info, getCompatString(R.string.room_mic_operate_member_info)))
|
|
|
+ add(Pair(R.id.id_mic_operate_kick, getCompatString(R.string.room_mic_operate_kick)))
|
|
|
+ add(Pair(R.id.id_mic_operate_lock, getCompatString(R.string.room_mic_operate_lock)))
|
|
|
+ if (seatView.micSeatInfo?.isRemoteMute() == true) {
|
|
|
+ add(Pair(R.id.id_mic_operate_un_mute, getCompatString(R.string.room_mic_operate_un_mute)))
|
|
|
+ } else {
|
|
|
+ add(Pair(R.id.id_mic_operate_mute, getCompatString(R.string.room_mic_operate_mute)))
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
} else {
|
|
|
//"我"是普通身份
|
|
|
if (isMicEmpty) {
|
|
|
//Ntd.
|
|
|
+ } else if (seatView.micIndex.index == onMicIndex) {
|
|
|
+ //操作自己的麦位
|
|
|
+ showMicActionList(seatView, mutableListOf<Pair<Int, String>>().apply {
|
|
|
+ add(Pair(R.id.id_mic_operate_member_info, getCompatString(R.string.room_mic_operate_member_info)))
|
|
|
+ add(Pair(R.id.id_mic_operate_off, getCompatString(R.string.room_mic_operate_off)))
|
|
|
+ })
|
|
|
+
|
|
|
} else {
|
|
|
- actionList.add(Pair(R.id.id_mic_operate_member_info, getCompatString(R.string.room_mic_operate_member_info)))
|
|
|
+ //actionList.add(Pair(R.id.id_mic_operate_member_info, getCompatString(R.string.room_mic_operate_member_info)))
|
|
|
+ Router.getRouterInstance<BottomDialogFragment>(Room.RoomMemberInfo.PATH)?.apply {
|
|
|
+ arguments = Bundle().apply {
|
|
|
+ putString(Room.Common.EXTRA_UID, seatView.micSeatInfo?.micUid())
|
|
|
+ }
|
|
|
+ }?.show(childFragmentManager)
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
@@ -163,22 +180,22 @@ class DispatchCenterSeatsTemplate :
|
|
|
return
|
|
|
} else {
|
|
|
//麦上有人
|
|
|
- actionList.add(Pair(R.id.id_mic_operate_member_info, getCompatString(R.string.room_mic_operate_member_info)))
|
|
|
+ //actionList.add(Pair(R.id.id_mic_operate_member_info, getCompatString(R.string.room_mic_operate_member_info)))
|
|
|
+ Router.getRouterInstance<BottomDialogFragment>(Room.RoomMemberInfo.PATH)?.apply {
|
|
|
+ arguments = Bundle().apply {
|
|
|
+ putString(Room.Common.EXTRA_UID, seatView.micSeatInfo?.micUid())
|
|
|
+ }
|
|
|
+ }?.show(childFragmentManager)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- showMicActionList(seatView, actionList)
|
|
|
}
|
|
|
|
|
|
private fun showMicActionList(seatView: DispatchCenterSeatView, actionList: List<Pair<Int, String>>) {
|
|
|
RoomTextActionDialog
|
|
|
.Builder()
|
|
|
.addTitle(
|
|
|
- getCompatString(
|
|
|
- R.string.room_mic_index_title,
|
|
|
- seatView.micIndex.micName.invoke()
|
|
|
- )
|
|
|
+ seatView.micIndex.micName.invoke()
|
|
|
).apply {
|
|
|
for (action in actionList) {
|
|
|
addItem(action.first, action.second)
|