小黑屋主动退出逻辑。
This commit is contained in:
@@ -246,7 +246,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
private var isShowPrivateMsg = false
|
||||
|
||||
var privateUserId: String="" //酒吧房小黑屋点击的返回,谁点击的返回,记录谁
|
||||
var isBackPrivate = false //是否主动返回小黑屋
|
||||
|
||||
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.action == KeyEvent.ACTION_DOWN) {
|
||||
@@ -603,7 +603,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
)
|
||||
}
|
||||
|
||||
mBinding?.clGold?.setOnClickListener { view : View ->
|
||||
mBinding?.clGold?.setOnClickListener { view: View ->
|
||||
this.onClick(
|
||||
view
|
||||
)
|
||||
@@ -1106,13 +1106,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
|
||||
// TODO: 小黑屋充值
|
||||
fun refillGold(){
|
||||
fun refillGold() {
|
||||
RechargeDialogFragment.show(roomId, null, supportFragmentManager, "", "")
|
||||
}
|
||||
|
||||
// TODO: 充值赋值
|
||||
fun goldAssignment(gold_coin: String){
|
||||
mBinding?.tvGold?.text = "余额:"+ gold_coin
|
||||
fun goldAssignment(gold_coin: String) {
|
||||
mBinding?.tvGold?.text = "余额:" + gold_coin
|
||||
|
||||
}
|
||||
|
||||
@@ -2490,7 +2490,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
|
||||
private fun handleMsgType1055(messageEvent: RoomMessageEvent) {
|
||||
if (privateUserId.isNotEmpty() && privateUserId != mRoomInfoResp?.user_info?.user_id.toString() + "") {
|
||||
if (!isBackPrivate) {
|
||||
MvpPre!!.quitRoom2(messageEvent.roomId, SpUtil.getUserId().toString() + "")
|
||||
quit()
|
||||
jiaR()
|
||||
@@ -2902,7 +2902,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
mBinding!!.svgaGift.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
} else if (id == R.id.cl_gold){
|
||||
} else if (id == R.id.cl_gold) {
|
||||
refillGold()
|
||||
}
|
||||
}
|
||||
@@ -3097,7 +3097,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
if (voive) View.VISIBLE else View.VISIBLE
|
||||
mBinding?.rlPrivateMsg?.visibility = View.VISIBLE
|
||||
mBinding?.rlEffects?.visibility = View.VISIBLE
|
||||
mBinding?.clGold?.visibility= View.VISIBLE
|
||||
mBinding?.clGold?.visibility = View.VISIBLE
|
||||
|
||||
if (SpUtil.getOpenEffect() == 1) {
|
||||
mBinding?.ivIcon?.setImageResource(com.xscm.moduleutil.R.mipmap.icon_close_effects)
|
||||
@@ -3130,7 +3130,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
if (voive) View.VISIBLE else View.GONE
|
||||
mBinding?.rlPrivateMsg?.visibility = View.GONE
|
||||
mBinding?.rlEffects?.visibility = View.GONE
|
||||
mBinding?.clGold?.visibility= View.GONE
|
||||
mBinding?.clGold?.visibility = View.GONE
|
||||
|
||||
}
|
||||
|
||||
@@ -4046,7 +4046,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
fun jiaR() {
|
||||
LogUtils.e(
|
||||
"@@@",
|
||||
"上一个房间的roonid:" + AgoraManager.getInstance().lastRoomId+",MvpPre :${MvpPre == null}"
|
||||
"上一个房间的roonid:" + AgoraManager.getInstance().lastRoomId + ",MvpPre :${MvpPre == null}"
|
||||
)
|
||||
MessageListenerSingleton.getInstance().joinGroup(AgoraManager.getInstance().lastRoomId)
|
||||
MvpPre?.getRoomIn(AgoraManager.getInstance().lastRoomId, "")
|
||||
@@ -4059,8 +4059,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
"@@@",
|
||||
"上一个房间的roonid" + AgoraManager.getInstance().lastRoomId
|
||||
)
|
||||
// TODO: 添加预防,当出现不能退出小黑屋的时候,执行这个操作
|
||||
if (AgoraManager.getInstance().lastRoomId.isNotEmpty()){
|
||||
// TODO: 主动退出小黑屋
|
||||
if (isBackPrivate) {
|
||||
isBackPrivate = false
|
||||
quit()
|
||||
jiaR()
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ class RoomPrivateFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
"取消",
|
||||
{
|
||||
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())
|
||||
|
||||
Reference in New Issue
Block a user