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