小黑屋主动退出逻辑。
This commit is contained in:
@@ -246,7 +246,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
|
|
||||||
private var isShowPrivateMsg = false
|
private var isShowPrivateMsg = false
|
||||||
|
|
||||||
var privateUserId: String="" //酒吧房小黑屋点击的返回,谁点击的返回,记录谁
|
var isBackPrivate = false //是否主动返回小黑屋
|
||||||
|
|
||||||
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) {
|
||||||
@@ -2490,7 +2490,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun handleMsgType1055(messageEvent: RoomMessageEvent) {
|
private fun handleMsgType1055(messageEvent: RoomMessageEvent) {
|
||||||
if (privateUserId.isNotEmpty() && privateUserId != mRoomInfoResp?.user_info?.user_id.toString() + "") {
|
if (!isBackPrivate) {
|
||||||
MvpPre!!.quitRoom2(messageEvent.roomId, SpUtil.getUserId().toString() + "")
|
MvpPre!!.quitRoom2(messageEvent.roomId, SpUtil.getUserId().toString() + "")
|
||||||
quit()
|
quit()
|
||||||
jiaR()
|
jiaR()
|
||||||
@@ -4059,8 +4059,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
"@@@",
|
"@@@",
|
||||||
"上一个房间的roonid" + AgoraManager.getInstance().lastRoomId
|
"上一个房间的roonid" + AgoraManager.getInstance().lastRoomId
|
||||||
)
|
)
|
||||||
// TODO: 添加预防,当出现不能退出小黑屋的时候,执行这个操作
|
// TODO: 主动退出小黑屋
|
||||||
if (AgoraManager.getInstance().lastRoomId.isNotEmpty()){
|
if (isBackPrivate) {
|
||||||
|
isBackPrivate = false
|
||||||
quit()
|
quit()
|
||||||
jiaR()
|
jiaR()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ class RoomPrivateFragment(var mRoomInfoResp: RoomInfoResp?) :
|
|||||||
"取消",
|
"取消",
|
||||||
{
|
{
|
||||||
if (ActivityUtils.getTopActivity() is RoomActivity) {
|
if (ActivityUtils.getTopActivity() is RoomActivity) {
|
||||||
(ActivityUtils.getTopActivity() as RoomActivity).privateUserId=mUserInfo?.user_id.toString()
|
(ActivityUtils.getTopActivity() as RoomActivity).isBackPrivate = true
|
||||||
}
|
}
|
||||||
//返回到上一个房间
|
//返回到上一个房间
|
||||||
MvpPre?.exitRoom(mRoomId, mUserInfo?.user_id.toString())
|
MvpPre?.exitRoom(mRoomId, mUserInfo?.user_id.toString())
|
||||||
|
|||||||
Reference in New Issue
Block a user