1:优化小黑屋退出房间后加入大房间 -2
This commit is contained in:
@@ -246,6 +246,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
|
|
||||||
private var isShowPrivateMsg = false
|
private var isShowPrivateMsg = false
|
||||||
|
|
||||||
|
var privateUserId: String="" //酒吧房小黑屋点击的返回,谁点击的返回,记录谁
|
||||||
|
|
||||||
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
|
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
|
||||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.action == KeyEvent.ACTION_DOWN) {
|
if (keyCode == KeyEvent.KEYCODE_BACK && event.action == KeyEvent.ACTION_DOWN) {
|
||||||
// 拦截返回键,显示退出对话框而不是直接退出
|
// 拦截返回键,显示退出对话框而不是直接退出
|
||||||
@@ -2488,9 +2490,11 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun handleMsgType1055(messageEvent: RoomMessageEvent) {
|
private fun handleMsgType1055(messageEvent: RoomMessageEvent) {
|
||||||
MvpPre!!.quitRoom2(messageEvent.roomId, SpUtil.getUserId().toString() + "")
|
if (privateUserId.isNotEmpty() && privateUserId != mRoomInfoResp?.user_info?.user_id.toString() + "") {
|
||||||
quit()
|
MvpPre!!.quitRoom2(messageEvent.roomId, SpUtil.getUserId().toString() + "")
|
||||||
jiaR()
|
quit()
|
||||||
|
jiaR()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleMsgType1035(messageEvent: RoomMessageEvent, text: T?) {
|
private fun handleMsgType1035(messageEvent: RoomMessageEvent, text: T?) {
|
||||||
@@ -4057,6 +4061,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
)
|
)
|
||||||
// TODO: 添加预防,当出现不能退出小黑屋的时候,执行这个操作
|
// TODO: 添加预防,当出现不能退出小黑屋的时候,执行这个操作
|
||||||
if (AgoraManager.getInstance().lastRoomId.isNotEmpty()){
|
if (AgoraManager.getInstance().lastRoomId.isNotEmpty()){
|
||||||
|
quit()
|
||||||
jiaR()
|
jiaR()
|
||||||
}
|
}
|
||||||
mBinding?.ivMic?.setImageResource(com.xscm.moduleutil.R.mipmap.room_microphone_off)
|
mBinding?.ivMic?.setImageResource(com.xscm.moduleutil.R.mipmap.room_microphone_off)
|
||||||
|
|||||||
@@ -141,6 +141,9 @@ class RoomPrivateFragment(var mRoomInfoResp: RoomInfoResp?) :
|
|||||||
"确定",
|
"确定",
|
||||||
"取消",
|
"取消",
|
||||||
{
|
{
|
||||||
|
if (ActivityUtils.getTopActivity() is RoomActivity) {
|
||||||
|
(ActivityUtils.getTopActivity() as RoomActivity).privateUserId=mUserInfo?.user_id.toString()
|
||||||
|
}
|
||||||
//返回到上一个房间
|
//返回到上一个房间
|
||||||
MvpPre?.exitRoom(mRoomId, mUserInfo?.user_id.toString())
|
MvpPre?.exitRoom(mRoomId, mUserInfo?.user_id.toString())
|
||||||
},
|
},
|
||||||
@@ -350,7 +353,7 @@ class RoomPrivateFragment(var mRoomInfoResp: RoomInfoResp?) :
|
|||||||
// ("退出房间时间:" + TimeUtils.date2String(Date())).toString() + ":退出的roomId" + mRoomId, "需要加入的房间:"+AgoraManager.getInstance().lastRoomId
|
// ("退出房间时间:" + TimeUtils.date2String(Date())).toString() + ":退出的roomId" + mRoomId, "需要加入的房间:"+AgoraManager.getInstance().lastRoomId
|
||||||
// )
|
// )
|
||||||
// MessageExListenerSingleton.quitGroup(mRoomId)
|
// MessageExListenerSingleton.quitGroup(mRoomId)
|
||||||
//// (activity as RoomActivity).quit()
|
// (activity as RoomActivity).quit()
|
||||||
//// CommonAppContext.getInstance().isPlaying = false
|
//// CommonAppContext.getInstance().isPlaying = false
|
||||||
//// CommonAppContext.getInstance().isShow = false
|
//// CommonAppContext.getInstance().isShow = false
|
||||||
CommonAppContext.getInstance().isMai = false
|
CommonAppContext.getInstance().isMai = false
|
||||||
|
|||||||
Reference in New Issue
Block a user