|
@@ -5,7 +5,6 @@ import android.graphics.Rect
|
|
|
import android.text.TextUtils
|
|
|
import android.util.Log
|
|
|
import android.view.View
|
|
|
-import android.view.ViewGroup
|
|
|
import android.widget.ImageView
|
|
|
import android.widget.TextView
|
|
|
import android.widget.Toast
|
|
@@ -26,7 +25,6 @@ import com.liulishuo.okdownload.core.cause.ResumeFailedCause
|
|
|
import com.permissionx.guolindev.PermissionX
|
|
|
import com.swago.baseswago.PersonDataDFragment
|
|
|
import com.swago.baseswago.UserVm
|
|
|
-import com.swago.baseswago.agora.AgoraManager
|
|
|
import com.swago.baseswago.baseroom.*
|
|
|
import com.swago.baseswago.constant.ARouteConstant
|
|
|
import com.swago.baseswago.constant.UrlConstant
|
|
@@ -60,8 +58,6 @@ import com.swago.room.databinding.FragmentBaseComBinding
|
|
|
import com.swago.room.dialog.AudienceListDialog
|
|
|
import com.swago.room.dialog.FanClubAnchorDialog
|
|
|
import com.swago.room.dialog.FanClubForUserDialog
|
|
|
-import com.swago.room.dialog.FooterMoreDialog
|
|
|
-import com.swago.room.dialog.HouseGoLiveDialog
|
|
|
import com.swago.room.dialog.JoinFanClubDialog
|
|
|
import com.swago.room.dialog.LevelUpDialog
|
|
|
import com.swago.room.dialog.MessageListDialog
|
|
@@ -96,7 +92,6 @@ import kotlinx.coroutines.CoroutineScope
|
|
|
import kotlinx.coroutines.Dispatchers
|
|
|
import kotlinx.coroutines.GlobalScope
|
|
|
import kotlinx.coroutines.Job
|
|
|
-import kotlinx.coroutines.cancel
|
|
|
import kotlinx.coroutines.delay
|
|
|
import kotlinx.coroutines.isActive
|
|
|
import kotlinx.coroutines.launch
|
|
@@ -148,9 +143,7 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
|
|
|
val job = Job()
|
|
|
val coroutineScope = CoroutineScope(Dispatchers.Main + job)
|
|
|
|
|
|
- var dialog: SendMsgDialog? = null
|
|
|
var gameDialog: GamePlayDialog? = null
|
|
|
- var msgListDialog: MessageListDialog? = null
|
|
|
|
|
|
val gameList by lazy {
|
|
|
ArrayList<GameModel>()
|
|
@@ -649,7 +642,10 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
|
|
|
|
|
|
msgVm.joinRoomFun = {
|
|
|
//svg播放
|
|
|
- joinAnimalManager.addSvgUrl(it)
|
|
|
+ if (!it.androidJoinSpecial.isNullOrEmpty()){
|
|
|
+ joinAnimalManager.addSvgUrl(it)
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
userVm.userInfoLiveData.observe(this) {
|
|
@@ -769,9 +765,7 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
|
|
|
|
|
|
override fun onDestroyView() {
|
|
|
super.onDestroyView()
|
|
|
- dialog = null
|
|
|
gameDialog = null
|
|
|
- msgListDialog = null
|
|
|
job.cancel()
|
|
|
PKStateManager.removePKListener(this)
|
|
|
activity?.let {
|
|
@@ -782,11 +776,11 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
|
|
|
}
|
|
|
|
|
|
fun openSendMessageDialog(atName: String = "") {
|
|
|
- dialog = SendMsgDialog.newInstance(atName)
|
|
|
- dialog?.addSenderMsgToRoomChatList = {
|
|
|
- addChatMsgToRv(it)
|
|
|
- }
|
|
|
- dialog?.show(childFragmentManager, "SendMsgDialog")
|
|
|
+ SendMsgDialog.newInstance(atName).apply {
|
|
|
+ this.addSenderMsgToRoomChatList = {
|
|
|
+ addChatMsgToRv(it)
|
|
|
+ }
|
|
|
+ }.show(childFragmentManager, "SendMsgDialog")
|
|
|
}
|
|
|
|
|
|
fun openMoreDialog(){
|
|
@@ -801,8 +795,7 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
|
|
|
}
|
|
|
|
|
|
fun openMessageListDialog() {
|
|
|
- msgListDialog = MessageListDialog.newInstance()
|
|
|
- msgListDialog?.show(childFragmentManager, "MessageListDialog")
|
|
|
+ MessageListDialog.newInstance().show(childFragmentManager, "MessageListDialog")
|
|
|
}
|
|
|
|
|
|
private var gameIsOpen = false
|
|
@@ -933,9 +926,7 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
|
|
|
|
|
|
override fun leaveRoom(iRoomInfo: IRoomInfo) {
|
|
|
dataChatList.clear()
|
|
|
- dialog = null
|
|
|
gameDialog = null
|
|
|
- msgListDialog = null
|
|
|
chatAdapter.notifyDataSetChanged()
|
|
|
if (iRoomInfo.getRoomType() == RoomType.AUDIO.type){
|
|
|
val data = ArrayList<AudioSeatModel>()
|
|
@@ -946,6 +937,7 @@ abstract class BaseComFragment<T : FragmentBaseComBinding> : BaseXFragment<T>(),
|
|
|
|
|
|
override fun closeRoomed() {
|
|
|
binding.likeLayout.clear()
|
|
|
+ gameDialog = null
|
|
|
RoomTimer.timeTickList.remove(this)
|
|
|
}
|
|
|
|