@@ -121,7 +121,6 @@ import com.xscm.moduleutil.bean.room.FriendInfo.HeartList
import com.xscm.moduleutil.bean.room.FriendUserBean
import com.xscm.moduleutil.bean.room.RoomAuction
import com.xscm.moduleutil.bean.room.RoomAuction.AuctionListBean
import com.xscm.moduleutil.bean.room.RoomBean
import com.xscm.moduleutil.bean.room.RoomHourBean
import com.xscm.moduleutil.bean.room.RoomInfoResp
import com.xscm.moduleutil.bean.room.RoomOnline
@@ -689,7 +688,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
LogUtils . e ( " RoomActivity " , " onPause " )
GiftDisplayManager . getInstance ( ) . clearAll ( )
if ( mRoomInfoResp != null ) {
if ( mRoomInfoResp !! .room _info .type _id != " 6 " ) {
if ( mRoomInfoResp ? .room _info ? .type _id != " 6 " ) {
// 只有在用户主动离开应用时才执行最小化操作
if ( ! userLeaving ) {
// 保持Activity alive, 不调用finish()
@@ -922,7 +921,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
val userIds = StringBuilder ( )
if ( mRoomInfoResp ?. room _info ?. pit _list != null ) {
for ( i in mRoomInfoResp ?. room _info ?. pit _list !! . indices ) {
val userId = mRoomInfoResp !! .room _info .pit _list [ i ] . user _id
val userId = mRoomInfoResp ? .room _info ? .pit _list !! [ i ] . user _id
if ( userId != null && userId != " 0 " && ! userId . isEmpty ( ) ) {
if ( userIds . length > 0 ) {
userIds . append ( " , " )
@@ -958,7 +957,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
if ( mRoomInfoResp !! .user _info .pit _number == 9 && mRoomInfoResp !! .user _info .user _id == SpUtil . getUserId ( ) ) {
if ( mRoomInfoResp ? .user _info ? .pit _number == 9 && mRoomInfoResp ? .user _info ? .user _id == SpUtil . getUserId ( ) ) {
ivSoundEffects ( true )
} else {
ivSoundEffects ( false )
@@ -973,13 +972,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
if ( mRoomInfoResp ?. gift _cycle ?. xlh _info ?. xlh _status == " 1 " ) {
mBinding ?. xlhRk ?. visibility = View . VISIBLE
xlhDjs ( mRoomInfoResp !! .gift _cycle .xlh _info .end _time )
xlhDjs ( mRoomInfoResp ? .gift _cycle ? .xlh _info ? .end _time )
} else {
mBinding ?. xlhRk ?. visibility = View . INVISIBLE
releaseCountDownTimer1 ( )
}
if ( mRoomInfoResp !! .hour _ranking _open == 1 ) {
if ( mRoomInfoResp ? .hour _ranking _open == 1 ) {
mBinding !! . clXsb . visibility = View . VISIBLE
} else {
mBinding !! . clXsb . visibility = View . GONE
@@ -1393,25 +1392,25 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
val userId = messageEvent . text ?. user _id
LogUtils . e ( " messageEvent!!.text.type " + messageEvent . text . type )
CommonAppContext . getInstance ( ) . onlineMap [ userId ?: " " ] = messageEvent . text . type
if ( mRoomInfoResp != null && mRoomInfoResp !! .room _info != null ) {
if ( mRoomInfoResp !! .room _info .type _id == " 1 " || mRoomInfoResp !! .room _info .type _id == " 3 " ||
mRoomInfoResp !! .room _info .type _id == " 4 " || mRoomInfoResp !! .room _info .type _id == " 8 "
if ( mRoomInfoResp != null && mRoomInfoResp ? .room _info != null ) {
if ( mRoomInfoResp ? .room _info ? .type _id == " 1 " || mRoomInfoResp ? .room _info ? .type _id == " 3 " ||
mRoomInfoResp ? .room _info ? .type _id == " 4 " || mRoomInfoResp ? .room _info ? .type _id == " 8 "
) {
if ( mRoomInfoResp !! .room _info .label _id == " 1 " ) {
if ( mRoomInfoResp ? .room _info ? .label _id == " 1 " ) {
// roomFragment!!.SingSongEvent(messageEvent)
} else {
roomFragment !! . handleRoomMessage ( messageEvent )
}
} else if ( mRoomInfoResp !! .room _info .type _id == " 2 " ) {
} else if ( mRoomInfoResp ? .room _info ? .type _id == " 2 " ) {
roomFragment !! . handleRoomMessage ( messageEvent )
} else if ( mRoomInfoResp !! .room _info .type _id == " 7 " ) {
} else if ( mRoomInfoResp ? .room _info ? .type _id == " 7 " ) {
roomFragment !! . handleRoomMessage ( messageEvent )
}
}
CommonAppContext . getInstance ( ) . getOnlineMap ( )
} else if ( msgType == EMMessageInfo . QXRoomMessageTypeQingGRMl ) { // 1059清除个人魅力 1058在离线
if ( mRoomInfoResp != null && mRoomInfoResp !! .room _info != null ) {
if ( mRoomInfoResp != null && mRoomInfoResp ? .room _info != null ) {
roomFragment !! . handleRoomMessage ( messageEvent )
}
} else if ( msgType == EMMessageInfo . QXRoomMessageTypeMangH ) { // 1056 抽奖结果
@@ -1533,11 +1532,11 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
private fun handleMsgType1039 ( messageEvent : RoomMessageEvent , text : T ? ) {
if ( mRoomInfoResp == null || mRoomInfoResp !! .room _info == null ) {
if ( mRoomInfoResp == null || mRoomInfoResp ? .room _info == null ) {
return
}
val pitList = mRoomInfoResp !! .room _info .pit _list
val pitList = mRoomInfoResp ? .room _info ? .pit _list
if ( pitList != null && ! pitList . isEmpty ( ) ) {
if ( text == null ) {
@@ -1560,13 +1559,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
toPitNumber : String ,
messageEvent : RoomMessageEvent
) {
mRoomInfoResp !! .room _info .pit _list [ toPitNumber . toInt ( ) - 1 ] = getPitBean ( messageEvent , 2 )
mRoomInfoResp ? .room _info ? .pit _list !! [ toPitNumber . toInt ( ) - 1 ] = getPitBean ( messageEvent , 2 )
mRoomInfoResp ?. room _info ?. pit _list !! [ fromPitNumber . toInt ( ) - 1 ] = RoomPitBean ( fromPitNumber )
if ( " 9 " == toPitNumber && messageEvent . text . fromUserInfo . user _id == SpUtil . getUserId ( ) ) {
mRoomInfoResp !! .user _info .pit _number = Integer . parseInt ( toPitNumber )
mRoomInfoResp ? .user _info ? .pit _number = Integer . parseInt ( toPitNumber )
ivSoundEffects ( true )
setRoleType ( 3 , mRoomInfoResp !! .user _info .pit _number )
setRoleType ( 3 , mRoomInfoResp ? .user _info ? .pit _number !! )
} else {
if ( customMusicFloatingView != null ) {
customMusicFloatingView !! . destroy ( )
@@ -1583,14 +1582,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
userPermissionChange ( )
if ( mRoomInfoResp !! .user _info .pit _number == 9 ) {
if ( mRoomInfoResp ? .user _info ? .pit _number == 9 ) {
ivSoundEffects ( true )
}
}
private fun hand1005 ( messageEvent : RoomMessageEvent , text : T ? ) {
if ( text == null || mRoomInfoResp == null || mRoomInfoResp !! .room _info == null ) return
if ( text == null || mRoomInfoResp == null || mRoomInfoResp ? .room _info == null ) return
roomFragment !! . handleRoomMessage ( messageEvent )
}
@@ -1628,17 +1627,17 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
AgoraManager . getInstance ( ) . desMusic ( )
if ( ( mRoomInfoResp !! .room _info .type _id == " 1 " || mRoomInfoResp !! .room _info .type _id == " 4 " ||
mRoomInfoResp !! .room _info .type _id == " 3 " || mRoomInfoResp !! .room _info .type _id == " 8 " ) &&
mRoomInfoResp !! .room _info .label _id == " 2 "
if ( ( mRoomInfoResp ? .room _info ? .type _id == " 1 " || mRoomInfoResp ? .room _info ? .type _id == " 4 " ||
mRoomInfoResp ? .room _info ? .type _id == " 3 " || mRoomInfoResp ? .room _info ? .type _id == " 8 " ) &&
mRoomInfoResp ? .room _info ? .label _id == " 2 "
) {
for ( roomPitBean in mRoomInfoResp !! .song _pit _list ) {
for ( roomPitBean in mRoomInfoResp ? .song _pit _list !! ) {
AgoraManager . getInstance ( ) . ClientRole ( false )
ivWheatFeeding ( com . xscm . moduleutil . R . mipmap . room _wheat _feeding )
mBinding ?. rlMic ?. visibility = View . GONE
}
if ( mRoomInfoResp !! .song _user _info != null && mRoomInfoResp !! .song _user _info .user _id != null ) {
if ( mRoomInfoResp !! .song _user _info .user _id == SpUtil . getUserId ( ) . toString ( ) + " " ) {
if ( mRoomInfoResp ? .song _user _info != null && mRoomInfoResp ? .song _user _info ? .user _id != null ) {
if ( mRoomInfoResp ? .song _user _info ? .user _id == SpUtil . getUserId ( ) . toString ( ) + " " ) {
AgoraManager . getInstance ( ) . ClientRole ( false )
ivWheatFeeding ( com . xscm . moduleutil . R . mipmap . room _wheat _feeding )
mBinding ?. rlMic ?. visibility = View . GONE
@@ -1666,7 +1665,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
private fun handleMsgType1003 ( messageEvent : RoomMessageEvent , text : T ? ) {
if ( text == null || mRoomInfoResp == null || mRoomInfoResp !! .room _info == null ) return
if ( text == null || mRoomInfoResp == null || mRoomInfoResp ? .room _info == null ) return
val fromUserInfo = text . fromUserInfo ?: return
@@ -1684,8 +1683,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
aBoolean = false
ivWheatFeeding ( com . xscm . moduleutil . R . mipmap . room _wheat _feeding _up )
setBoolean ( aBoolean )
if ( mRoomInfoResp !! .user _info != null ) {
mRoomInfoResp !! .user _info .pit _number =
if ( mRoomInfoResp ? .user _info != null ) {
mRoomInfoResp ? .user _info ? .pit _number =
pitNumber ?. toInt ( ) ?: - 1
}
setRoleType ( 3 , pitNumber !! . toInt ( ) )
@@ -1697,9 +1696,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
when ( typeId ) {
RoomType . AUCTION -> {
if ( " 9 " == pitNumber ) {
mRoomInfoResp !! .room _info .pit _list [ 0 ] = getPitBean ( messageEvent , 1 )
if ( mRoomInfoResp !! .user _info != null ) {
mRoomInfoResp !! .user _info .pit _number = pitNumber . toInt ( )
mRoomInfoResp ? .room _info ? .pit _list !! [ 0 ] = getPitBean ( messageEvent , 1 )
if ( mRoomInfoResp ? .user _info != null ) {
mRoomInfoResp ? .user _info ? .pit _number = pitNumber . toInt ( )
}
}
roomFragment !! . upRoomInfoData ( mRoomInfoResp )
@@ -1707,11 +1706,11 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
RoomType . DATING -> {
val labelId = mRoomInfoResp !! .room _info .label _id
val labelId = mRoomInfoResp ? .room _info ? .label _id
if ( " 2 " == labelId ) {
roomFragment !! . handleRoomMessage ( messageEvent )
} else if ( " 1 " == labelId ) {
mRoomInfoResp !! .room _info .pit _list [ pitNumber . toInt ( ) - 1 ] =
mRoomInfoResp ? .room _info ? .pit _list !! [ pitNumber . toInt ( ) - 1 ] =
getPitBean ( messageEvent , 1 )
roomFragment !! . upRoomInfoData ( mRoomInfoResp )
roomFragment !! . handleRoomMessage ( messageEvent )
@@ -1736,7 +1735,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
private fun handleMsgType1004 ( messageEvent : RoomMessageEvent , text : T ? ) {
if ( text == null || mRoomInfoResp == null || mRoomInfoResp !! .room _info == null ) return
if ( text == null || mRoomInfoResp == null || mRoomInfoResp ? .room _info == null ) return
val fromUserInfo = text . fromUserInfo ?: return
@@ -1766,7 +1765,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
switchMic ( 2 )
}
val typeId = mRoomInfoResp !! .room _info .type _id
val typeId = mRoomInfoResp ? .room _info ? .type _id
val roomType = RoomType . fromTypeId ( typeId )
@@ -1774,14 +1773,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
when ( roomType ) {
RoomType . AUCTION -> {
if ( " 9 " == pitNumber ) {
mRoomInfoResp !! .room _info .pit _list [ 0 ] = RoomPitBean ( pitNumber )
mRoomInfoResp ? .room _info ? .pit _list !! [ 0 ] = RoomPitBean ( pitNumber )
if ( userId == currentUserId ) {
if ( mRoomInfoResp !! .user _info != null ) {
mRoomInfoResp !! .user _info .pit _number = 0
if ( mRoomInfoResp ? .user _info != null ) {
mRoomInfoResp ? .user _info ? .pit _number = 0
}
}
} else if ( " 888 " == pitNumber ) { //被拍者
mRoomInfoResp !! .room _auction = null
mRoomInfoResp ? .room _auction = null
if ( userId == currentUserId ) {
setRoleType ( 0 , 0 )
switchMic ( 2 )
@@ -1792,12 +1791,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
RoomType . DATING -> {
//TODO 下麦更换数据
val labelId = mRoomInfoResp !! .room _info .label _id
val labelId = mRoomInfoResp ? .room _info ? .label _id
if ( " 1 " == labelId ) {
mRoomInfoResp ?. room _info ?. pit _list !! [ pitNumber . toInt ( ) - 1 ] = RoomPitBean ( pitNumber )
roomFragment !! . upRoomInfoData ( mRoomInfoResp )
if ( mRoomInfoResp !! .user _info .user _id == SpUtil . getUserId ( ) ) {
if ( mRoomInfoResp ? .user _info ? .user _id == SpUtil . getUserId ( ) ) {
ivSoundEffects ( false )
}
}
@@ -1816,7 +1815,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
private fun handleMsgType1022 ( messageEvent : RoomMessageEvent , text : T ? ) {
if ( text == null || mRoomInfoResp == null || mRoomInfoResp !! .room _info == null ) return
if ( text == null || mRoomInfoResp == null || mRoomInfoResp ? .room _info == null ) return
val pitNumber = text . pit _number
val userId = text . fromUserInfo . user _id
@@ -1834,7 +1833,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
setRoleType ( 0 , 0 )
switchMic ( 2 )
} else if ( " 888 " == pitNumber ) {
mRoomInfoResp !! .room _auction = RoomAuction ( )
mRoomInfoResp ? .room _auction = RoomAuction ( )
if ( userId == currentUserId ) {
setRoleType ( 0 , 0 )
switchMic ( 2 )
@@ -1847,23 +1846,23 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
private fun handleMsgType1023 ( messageEvent : RoomMessageEvent , text : T ? ) {
if ( text == null || mRoomInfoResp == null || mRoomInfoResp !! .room _auction == null ) return
if ( text == null || mRoomInfoResp == null || mRoomInfoResp ? .room _auction == null ) return
mRoomInfoResp !! .room _auction .auction _user = text . auction _user
mRoomInfoResp ? .room _auction ? .auction _user = text . auction _user
SpUtil . setAuctionId ( text . auction _user . auction _id )
roomFragment !! . upRoomInfoData ( mRoomInfoResp )
roomFragment !! . handleRoomMessage ( messageEvent )
}
private fun handleMsgType1024 ( messageEvent : RoomMessageEvent , text : T ? ) {
if ( text == null || mRoomInfoResp == null || mRoomInfoResp !! .room _auction == null ) return
if ( mRoomInfoResp !! .room _auction .auction _list != null ) {
mRoomInfoResp !! .room _auction .auction _list . clear ( )
if ( text == null || mRoomInfoResp == null || mRoomInfoResp ? .room _auction == null ) return
if ( mRoomInfoResp ? .room _auction ? .auction _list != null ) {
mRoomInfoResp ? .room _auction ? .auction _list !! . clear ( )
}
if ( mRoomInfoResp !! .room _auction .auction _list != null && text . auction _list != null ) {
mRoomInfoResp !! .room _auction .auction _list . addAll ( text . auction _list )
if ( mRoomInfoResp ? .room _auction ? .auction _list != null && text . auction _list != null ) {
mRoomInfoResp ? .room _auction ? .auction _list !! . addAll ( text . auction _list )
} else {
mRoomInfoResp !! .room _auction .auction _list = ArrayList ( )
mRoomInfoResp ? .room _auction ? .auction _list = ArrayList ( )
}
roomFragment !! . upRoomInfoData ( mRoomInfoResp )
roomFragment !! . handleRoomMessage ( messageEvent )
@@ -1905,6 +1904,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
if ( roomMessageEvent . text . fromUserInfo . enter _image ?. isNotEmpty ( ) == true ) {
showFloatingMessage ( roomMessageEvent . text . fromUserInfo )
}
MvpPre ?. getRoomOnline ( roomId , " 1 " , " 10 " )
// number++
@@ -2045,21 +2045,21 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
private fun handleMsgType1029 ( messageEvent : RoomMessageEvent , text : T ? ) {
if ( text == null || mRoomInfoResp == null || mRoomInfoResp !! .user _info == null ) return
if ( text == null || mRoomInfoResp == null || mRoomInfoResp ? .user _info == null ) return
if ( mRoomInfoResp !! .user _info .pit _number == 9 && mRoomInfoResp !! .user _info .user _id == SpUtil . getUserId ( ) ) {
if ( mRoomInfoResp ? .user _info ? .pit _number == 9 && mRoomInfoResp ? .user _info ? .user _id == SpUtil . getUserId ( ) ) {
querenPk ( text . text , text . pkId )
}
}
private fun handleMsgType1021 ( messageEvent : RoomMessageEvent , text : T ) {
if ( mRoomInfoResp == null || mRoomInfoResp !! .room _info == null ) return
if ( mRoomInfoResp == null || mRoomInfoResp ? .room _info == null ) return
val typeId = mRoomInfoResp !! .room _info .type _id
val typeId = mRoomInfoResp ? .room _info ? .type _id
if ( " 2 " == typeId ) {
roomFragment !! . handleRoomMessage ( messageEvent )
} else if ( " 1 " == typeId || " 4 " == typeId || " 3 " == typeId || " 8 " == typeId ) {
val labelId = mRoomInfoResp !! .room _info .label _id
val labelId = mRoomInfoResp ? .room _info ? .label _id
if ( " 2 " == labelId ) {
roomFragment !! . handleRoomMessage ( messageEvent )
} else {
@@ -2069,14 +2069,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
} else {
updateCharmForAllPitBeans ( " " )
roomFragment !! . upFriendList ( mRoomInfoResp !! .room _info .pit _list )
roomFragment !! . upFriendList ( mRoomInfoResp ? .room _info ? .pit _list )
}
}
private fun updateCharmForAllPitBeans ( charm : String ) {
if ( mRoomInfoResp == null || mRoomInfoResp !! .room _info == null ) return
if ( mRoomInfoResp == null || mRoomInfoResp ? .room _info == null ) return
val pitList = mRoomInfoResp !! .room _info .pit _list ?: return
val pitList = mRoomInfoResp ? .room _info ? .pit _list ?: return
pitList . forEach { roomPitBean ->
roomPitBean . charm = charm
}
@@ -2191,15 +2191,15 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
private fun handleMsgType1035 ( messageEvent : RoomMessageEvent , text : T ? ) {
if ( text == null || mRoomInfoResp == null || mRoomInfoResp !! .room _info == null ) return
if ( text == null || mRoomInfoResp == null || mRoomInfoResp ? .room _info == null ) return
val fromUserInfo = text . fromUserInfo ?: return
val typeId = mRoomInfoResp !! .room _info .type _id
val typeId = mRoomInfoResp ? .room _info ? .type _id
if ( " 2 " == typeId ) {
roomFragment !! . handleRoomMessage ( messageEvent )
} else if ( " 1 " == typeId || " 3 " == typeId || " 4 " == typeId || " 8 " == typeId ) {
val labelId = mRoomInfoResp !! .room _info .label _id
val labelId = mRoomInfoResp ? .room _info ? .label _id
if ( " 2 " == labelId ) {
roomFragment !! . handleRoomMessage ( messageEvent )
} else {
@@ -2213,9 +2213,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
private fun updatePitBeanForUser ( fromUserInfo : UserInfo ) : RoomInfoResp ? {
if ( mRoomInfoResp == null || mRoomInfoResp !! .room _info == null ) return mRoomInfoResp
if ( mRoomInfoResp == null || mRoomInfoResp ? .room _info == null ) return mRoomInfoResp
val pitList = mRoomInfoResp !! .room _info .pit _list ?: return mRoomInfoResp
val pitList = mRoomInfoResp ? .room _info ? .pit _list ?: return mRoomInfoResp
for ( pitBean in pitList ) {
if ( pitBean . user _id == fromUserInfo . user _id . toString ( ) + " " ) {
@@ -2248,32 +2248,32 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
private fun handleMsgType1007 ( ) {
if ( mRoomInfoResp != null && mRoomInfoResp !! .user _info != null ) {
mRoomInfoResp !! .user _info .is _host = 1
if ( mRoomInfoResp != null && mRoomInfoResp ? .user _info != null ) {
mRoomInfoResp ? .user _info ? .is _host = 1
userPermissionChange ( )
roomFragment !! . upRoomInfoData ( mRoomInfoResp )
}
}
private fun handleMsgType1006 ( ) {
if ( mRoomInfoResp != null && mRoomInfoResp !! .user _info != null ) {
mRoomInfoResp !! .user _info .is _management = 1
if ( mRoomInfoResp != null && mRoomInfoResp ? .user _info != null ) {
mRoomInfoResp ? .user _info ? .is _management = 1
userPermissionChange ( )
roomFragment !! . upRoomInfoData ( mRoomInfoResp )
}
}
private fun handleMsgType1018 ( ) {
if ( mRoomInfoResp != null && mRoomInfoResp !! .user _info != null ) {
mRoomInfoResp !! .user _info .is _host = 0
if ( mRoomInfoResp != null && mRoomInfoResp ? .user _info != null ) {
mRoomInfoResp ? .user _info ? .is _host = 0
userPermissionChange ( )
roomFragment !! . upRoomInfoData ( mRoomInfoResp )
}
}
private fun handleMsgType1017 ( ) {
if ( mRoomInfoResp != null && mRoomInfoResp !! .user _info != null ) {
mRoomInfoResp !! .user _info .is _management = 0
if ( mRoomInfoResp != null && mRoomInfoResp ? .user _info != null ) {
mRoomInfoResp ? .user _info ? .is _management = 0
userPermissionChange ( )
roomFragment !! . upRoomInfoData ( mRoomInfoResp )
}
@@ -2314,14 +2314,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
private fun handleMsgType1016 ( messageEvent : RoomMessageEvent , text : T ? ) {
if ( text == null || mRoomInfoResp == null || mRoomInfoResp !! .user _info == null ) return
if ( text == null || mRoomInfoResp == null || mRoomInfoResp ? .user _info == null ) return
if ( text . fromUserInfo . user _id == SpUtil . getUserId ( ) ) {
if ( text . is _mute _pit == 1 ) {
switchMic ( 2 )
}
mRoomInfoResp !! .user _info .is _mute _pit = text . is _mute _pit . toString ( )
mRoomInfoResp !! .user _info .is _mute = text . is _mute . toString ( )
mRoomInfoResp ? .user _info ? .is _mute _pit = text . is _mute _pit . toString ( )
mRoomInfoResp ? .user _info ? .is _mute = text . is _mute . toString ( )
}
}
@@ -2387,7 +2387,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
fun setUserInfo ( ) {
mRoomInfoResp !! .user _info .is _collect = 1
mRoomInfoResp ? .user _info ? .is _collect = 1
mBinding !! . roomTop . btnFollow . background =
resources . getDrawable ( com . xscm . moduleutil . R . mipmap . yishouc )
mBinding !! . roomTop . btnFollow . text = " "
@@ -2406,8 +2406,17 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
return
}
val id = view . id
// 通过 ID 获取资源名称
var viewName = try {
view . context . resources . getResourceEntryName ( id )
} catch ( e : java . lang . Exception ) {
" 未知View ID: $id "
}
LogUtils . e ( " RoomActivity " , " 点击了 $viewName " )
if ( id == R . id . btn _follow ) {
MvpPre !! . userGuanz ( mRoomInfoResp !! .room _info .room _id , " 2 " )
MvpPre !! . userGuanz ( mRoomInfoResp ? .room _info ? .room _id , " 2 " )
} else if ( id == R . id . btn _notice ) {
val roomNoticeDialogFragment = RoomNoticeDialogFragment ( this )
roomNoticeDialogFragment . setTitle ( " 公告 " )
@@ -2431,8 +2440,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} else if ( id == R . id . rl ) {
MvpPre !! . clearUserCharm ( roomId , " " )
} else if ( id == R . id . ll _input ) {
mBinding !! .llInput .visibility = View . GONE
mBinding !! .inputMenu1 .dismiss ( )
mBinding ? .llInput ? .visibility = View . GONE
mBinding ? .inputMenu1 ? .dismiss ( )
} else if ( id == R . id . iv _emoji ) {
val emotionPickerDialog = EmotionPickerDialog ( this )
emotionPickerDialog . setOnEmotionSelectedListener { emotion ->
@@ -2443,13 +2452,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
emotionPickerDialog . show ( )
} else if ( id == R . id . iv _chat ) {
if ( mRoomInfoResp !! .user _info .is _mute == " 1 " ) {
if ( mRoomInfoResp ? .user _info ? .is _mute == " 1 " ) {
ToastUtils . show ( " 您已经被禁言 " )
} else {
dialogDismiss ( 1 )
}
} else if ( id == R . id . rl _mic ) {
if ( mRoomInfoResp !! .user _info .is _mute _pit != null && mRoomInfoResp !! .user _info .is _mute _pit == " 1 " ) {
if ( mRoomInfoResp ? .user _info ? .is _mute _pit != null && mRoomInfoResp ? .user _info ? .is _mute _pit == " 1 " ) {
ToastUtils . show ( " 您被禁麦了 " )
} else {
if ( isSwith ) {
@@ -2527,10 +2536,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
} else if ( id == R . id . cl _first _charge ) {
roomFragment !! . showWheatFeedingDialog (
roomId ,
if ( ( mRoomInfoResp !! .user _info .is _room _owner == 1 || mRoomInfoResp !! .user _info .is _host == 1 || mRoomInfoResp !! .user _info .is _management == 1 ) ) 1 else 2
if ( ( mRoomInfoResp ? .user _info ? .is _room _owner == 1 || mRoomInfoResp ? .user _info ? .is _host == 1 || mRoomInfoResp ? .user _info ? .is _management == 1 ) ) 1 else 2
)
} else if ( id == R . id . iv _wheat _feeding ) { //点击上麦操作
if ( mRoomInfoResp !! .room _info .room _up _pit _type == " 1 " ) {
if ( mRoomInfoResp ? .room _info ? .room _up _pit _type == " 1 " ) {
if ( aBoolean ) {
MvpPre !! . applyPit ( roomId , " " )
} else {
@@ -2565,7 +2574,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
private fun isNumberWhether ( ) : Int {
if ( mRoomInfoResp !! . getUser _info ( ) . getP it_number ( ) == 9 ) {
if ( mRoomInfoResp ?. user _info ?. p it_number == 9 ) {
return 1
}
return 0
@@ -2632,7 +2641,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
if ( mRoomInfoResp == null ) {
return true
}
if ( mRoomInfoResp !! .room _info .label _id != " 6 " ) {
if ( mRoomInfoResp ? .room _info ? .label _id != " 6 " ) {
val activityManager =
getSystemService ( Context . ACTIVITY _SERVICE ) as ActivityManager
val appProcesses =
@@ -2806,12 +2815,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
rl _misc ?. visibility = View . GONE
// 空指针保护
if ( mRoomInfoResp == null || mRoomInfoResp !! .room _info == null || mRoomInfoResp !! .user _info == null ) {
if ( mRoomInfoResp == null || mRoomInfoResp ? .room _info == null || mRoomInfoResp ? .user _info == null ) {
return
}
val typeId = mRoomInfoResp !! .room _info .type _id
val labelId = mRoomInfoResp !! .room _info .label _id
val typeId = mRoomInfoResp ? .room _info ? .type _id
val labelId = mRoomInfoResp ? .room _info ? .label _id
val userPitNumber = mRoomInfoResp ?. user _info ?. pit _number !!
// 情况1: typeId = 6 时,只显示消息按钮
@@ -2916,7 +2925,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
val t = T ( )
t . fromUserInfo = SpUtil . getUserInfo ( )
t . text = s
val roomMessageEvent = RoomMessageEvent ( 126 , mRoomInfoResp !! .room _info .room _id , t )
val roomMessageEvent = RoomMessageEvent ( 126 , mRoomInfoResp ? .room _info ? .room _id , t )
val json = GsonUtils . toJson ( roomMessageEvent )
// 转换为 byte[]
val binaryData = json . toByteArray ( StandardCharsets . UTF _8 )
@@ -2931,7 +2940,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
@SuppressLint ( " MissingInflatedId " )
fun dialogDismiss ( type : Int ) {
// // 使用 AlertDialog.Builder
val builder = AlertDialog . Builder ( this )
val inflater = layoutInflater
val dialogView =
@@ -3067,7 +3075,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
userPermissionChange ( )
if ( mRoomInfoResp !! .user _info .pit _number == 9 && mRoomInfoResp !! .user _info .user _id == SpUtil . getUserId ( ) ) {
if ( mRoomInfoResp ? .user _info ? .pit _number == 9 && mRoomInfoResp ? .user _info ? .user _id == SpUtil . getUserId ( ) ) {
ivSoundEffects ( true )
} else {
ivSoundEffects ( false )
@@ -3091,7 +3099,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
//隐藏视图
private fun instView ( ) {
if ( mRoomInfoResp !! .user _info .pit _number != 0 ) {
if ( mRoomInfoResp ? .user _info ? .pit _number != 0 ) {
aBoolean = false
ivWheatFeeding ( com . xscm . moduleutil . R . mipmap . room _wheat _feeding _up )
setrlMic ( true )
@@ -3102,31 +3110,31 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
setrlMic ( false )
setBoolean ( aBoolean )
}
val pitNumber = mRoomInfoResp !! .user _info .pit _number
val pitNumber = mRoomInfoResp ? .user _info ? .pit _number
val roleType = if ( pitNumber == 9 ) {
if ( mRoomInfoResp !! .user _info .is _room _owner != 0 ) 1 else if ( mRoomInfoResp !! .user _info .is _host != 0 ) 2 else 0
if ( mRoomInfoResp ? .user _info ? .is _room _owner != 0 ) 1 else if ( mRoomInfoResp ? .user _info ? .is _host != 0 ) 2 else 0
} else if ( pitNumber != 0 && pitNumber != 9 ) {
3
} else {
0
}
if ( mRoomInfoResp !! .user _info .pit _number == 9 ) {
if ( mRoomInfoResp ? .user _info ? .pit _number == 9 ) {
ivSoundEffects ( true )
} else {
ivSoundEffects ( false )
}
// }
if ( mRoomInfoResp ?. user _info ?. user _id == SpUtil . getUserId ( )
&& mRoomInfoResp !! .user _info .pit _number == 9
&& mRoomInfoResp !! .room _info .type _id != " 2 "
&& mRoomInfoResp !! .room _info .type _id != " 6 "
&& mRoomInfoResp ? .user _info ? .pit _number == 9
&& mRoomInfoResp ? .room _info ? .type _id != " 2 "
&& mRoomInfoResp ? .room _info ? .type _id != " 6 "
) {
rlMore ( true )
} else {
rlMore ( false )
}
val countText = mRoomInfoResp !! .room _info .queue _number . toString ( )
val countText = mRoomInfoResp ? .room _info ? .queue _number . toString ( )
val fullText = countText + " 人排队 "
val spannableStringBuilder = SpannableStringBuilder ( fullText )
@@ -3143,18 +3151,18 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
)
tvFirst ( spannableStringBuilder )
setRoleType ( roleType , pitNumber )
setRoleType ( roleType , pitNumber !! )
}
/** 头条 */
@SuppressLint ( " ClickableViewAccessibility " )
fun toutiao ( ) {
if ( mRoomInfoResp !! .room _info .head _line != null ) {
if ( mRoomInfoResp ? .room _info ? .head _line != null ) {
mBinding !! . flaoatZuoji . visibility = View . VISIBLE
ImageUtils . loadHeadCC ( mRoomInfoResp !! .room _info .head _line .avatar , mBinding !! . headAvate )
mBinding !! . headName . text = mRoomInfoResp !! .room _info .head _line .nickname
mBinding !! . headCone . text = mRoomInfoResp !! .room _info .head _line .content
ImageUtils . loadHeadCC ( mRoomInfoResp ? .room _info ? .head _line ? .avatar , mBinding !! . headAvate )
mBinding !! . headName . text = mRoomInfoResp ? .room _info ? .head _line ? .nickname
mBinding !! . headCone . text = mRoomInfoResp ? .room _info ? .head _line ? .content
mBinding !! . ivQuanQiang . setOnClickListener { v : View ? ->
val fragment = PublishCommentDialogFragment . show (
@@ -3166,11 +3174,11 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
}
mBinding !! . ivQuanC . setOnClickListener { v : View ? ->
if ( mRoomInfoResp !! .room _info .head _line .room _id != null && mRoomInfoResp !! .room _info .head _line .room _id . isNotEmpty ( ) ) {
if ( mRoomInfoResp !! .room _info .head _line .room _id != roomId ) {
if ( mRoomInfoResp ? .room _info ? .head _line ? .room _id != null && mRoomInfoResp ? .room _info ? .head _line ? .room _id !! . isNotEmpty ( ) ) {
if ( mRoomInfoResp ? .room _info ? .head _line ? .room _id != roomId ) {
RoomManager . getInstance ( ) . fetchRoomDataAndEnter (
applicationContext ,
mRoomInfoResp !! .room _info .head _line .room _id ,
mRoomInfoResp ? .room _info ? .head _line ? .room _id ,
" " ,
null
)
@@ -3241,7 +3249,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
hideSomeViewOrDoSomething ( )
}
silentCountDownTimer !! . start ( mRoomInfoResp !! .room _info .head _line .end _time . toLong ( ) )
silentCountDownTimer !! . start ( mRoomInfoResp ? .room _info ? .head _line ? .end _time !! . toLong ( ) )
} else {
mBinding !! . flaoatZuoji . visibility = View . GONE
}
@@ -3328,9 +3336,9 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
is SurfaceEvent -> {
if ( mRoomInfoResp !! .room _info .type _id == " 6 " ) { //判断是否是电影房
if ( mRoomInfoResp ? .room _info ? .type _id == " 6 " ) { //判断是否是电影房
floatingMagnetView = findViewById ( R . id . flaoat ) //电影房
if ( mRoomInfoResp !! .user _info .is _room _owner != 1 ) { //判断是不是房主, 1: 是 如何是,不展示 0不是, 展示布局
if ( mRoomInfoResp ? .user _info ? .is _room _owner != 1 ) { //判断是不是房主, 1: 是 如何是,不展示 0不是, 展示布局
if ( event . type != 1 ) {
val container =
floatingMagnetView ?. findViewById < FrameLayout > ( R . id . fl _screenshare )
@@ -3450,7 +3458,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
is HeadlineBean -> {
mRoomInfoResp !! .room _info .head _line = event
mRoomInfoResp ? .room _info ? .head _line = event
toutiao ( )
}
@@ -3552,6 +3560,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
GiftDisplayManager . getInstance ( ) . setupDisplayView ( mBinding ?. giftContainer )
}
// 添加检查房间连接状态的方法
private fun resumeRoomState ( ) {
// 恢复房间相关状态
@@ -3717,20 +3727,20 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
fun upHeight ( ) {
if ( mRoomInfoResp !! .room _info .type _id == " 1 " || mRoomInfoResp !! .room _info .type _id == " 3 " || mRoomInfoResp !! .room _info .type _id == " 4 "
|| mRoomInfoResp !! .room _info .type _id == " 8 "
if ( mRoomInfoResp ? .room _info ? .type _id == " 1 " || mRoomInfoResp ? .room _info ? .type _id == " 3 " || mRoomInfoResp ? .room _info ? .type _id == " 4 "
|| mRoomInfoResp ? .room _info ? .type _id == " 8 "
) {
maxHeightDp = if ( mRoomInfoResp !! .room _info .label _id == " 1 " ) {
maxHeightDp = if ( mRoomInfoResp ? .room _info ? .label _id == " 1 " ) {
333
} else {
287
}
} else if ( mRoomInfoResp !! .room _info .type _id == " 2 " ) {
} else if ( mRoomInfoResp ? .room _info ? .type _id == " 2 " ) {
maxHeightDp = 297
}
if ( mRoomInfoResp !! .room _info .type _id == " 6 " ) {
if ( mRoomInfoResp ? .room _info ? .type _id == " 6 " ) {
maxHeightDp = 453
} else if ( mRoomInfoResp !! .room _info .type _id == " 7 " ) {
} else if ( mRoomInfoResp ? .room _info ? .type _id == " 7 " ) {
maxHeightDp = 373
}
adjustLayoutHeights ( )
@@ -3738,35 +3748,35 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
@SuppressLint ( " CommitTransaction " )
private fun resetFragment ( ) {
val typeId = mRoomInfoResp !! .room _info .type _id
val labelId = mRoomInfoResp !! .room _info .label _id
val typeId = mRoomInfoResp ? .room _info ? .type _id
val labelId = mRoomInfoResp ? .room _info ? .label _id
CommonAppContext . getInstance ( ) . lable _id = typeId
val roomType = RoomType . fromTypeId ( typeId )
val qxType : QXRoomSeatViewType = when ( roomType ) {
RoomType . MUTUAL _ENTERTAINMENT -> {
if ( mRoomInfoResp !! .room _info .room _background == null || mRoomInfoResp !! .room _info .room _background == " " ) {
if ( mRoomInfoResp ? .room _info ? .room _background == null || mRoomInfoResp ? .room _info ? .room _background == " " ) {
changeBackground ( com . xscm . moduleutil . R . mipmap . jiaoy _bj )
} else {
changeBackgroundColor ( mRoomInfoResp !! .room _info .room _background )
changeBackgroundColor ( mRoomInfoResp ? .room _info ? .room _background )
}
setvisibTop ( true )
QXRoomSeatViewType . FRIEND
}
RoomType . AUCTION -> {
changeBackgroundColor ( mRoomInfoResp !! .room _info .room _background )
changeBackgroundColor ( mRoomInfoResp ? .room _info ? .room _background )
setvisibTop ( true )
QXRoomSeatViewType . AUCTION
}
RoomType . DATING -> {
if ( " 2 " == labelId ) {
changeBackgroundColor ( mRoomInfoResp !! .room _info .room _background )
changeBackgroundColor ( mRoomInfoResp ? .room _info ? .room _background )
setvisibTop ( true )
QXRoomSeatViewType . KTV
} else if ( " 1 " == labelId ) {
changeBackgroundColor ( mRoomInfoResp !! .room _info .room _background )
changeBackgroundColor ( mRoomInfoResp ? .room _info ? .room _background )
setvisibTop ( true )
QXRoomSeatViewType . NORMAL
} else {
@@ -4289,7 +4299,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
if ( redEnvelopesFragment !! . mRedPacketInfo . type == 1 ) {
if ( redEnvelopesFragment !! . mRedPacketInfo . conditions . contains ( " 1 " ) ) {
//有收藏房间条件
if ( mRoomInfoResp !! .user _info .is _collect == 1 ) {
if ( mRoomInfoResp ? .user _info ? .is _collect == 1 ) {
if ( packet !! . redpacket _id == redEnvelopesFragment !! . mRedPacketInfo . redpacket _id ) {
//需要满足收藏在倒计时
redEnvelopesFragment !! . setNeedTime ( packetTime )
@@ -4304,7 +4314,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
if ( redEnvelopesFragment !! . isFromToComment ) {
if ( redEnvelopesFragment !! . mRedPacketInfo . conditions . contains ( " 1 " ) ) {
//有收藏房间条件
if ( mRoomInfoResp !! .user _info .is _collect == 1 ) {
if ( mRoomInfoResp ? .user _info ? .is _collect == 1 ) {
if ( packet !! . redpacket _id == redEnvelopesFragment !! . mRedPacketInfo . redpacket _id ) {
redEnvelopesFragment !! . setNeedTime ( packetTime )
}
@@ -4363,4 +4373,5 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
return false // 不是快速重复点击
}
}