fix:修复个播粉丝团入口展示问题(进入有密码房间时因请求时机导致未正确加载状态)
This commit is contained in:
@@ -355,6 +355,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
updateRemoteMuteBtn()
|
||||
openOrCloseGiftValue(true)
|
||||
GiftValueMrg.get().updateRoomGiftValue(false)
|
||||
onEnterRoom()
|
||||
}
|
||||
|
||||
RoomEvent.ADD_BLACK_LIST -> onChatRoomMemberBlackAdd(roomEvent.account)
|
||||
@@ -1362,4 +1363,8 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
inputEdit.requestFocus()
|
||||
KeyBoardUtils.showKeyBoard(context, inputEdit)
|
||||
}
|
||||
|
||||
protected open fun onEnterRoom(){
|
||||
|
||||
}
|
||||
}
|
@@ -166,49 +166,6 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
}
|
||||
}
|
||||
gameBinding.flFansTeam.setOnClickListener(clickListener)
|
||||
|
||||
|
||||
//
|
||||
// var clickListener: View.OnClickListener? = null
|
||||
// gameBinding.flFansTeam.isGone =
|
||||
// !AvRoomDataManager.get().isRoomOwner && !initInfo.hasFansTeamCurrentRoom
|
||||
// if (initInfo.hasFansTeamCurrentRoom) {
|
||||
// if (AvRoomDataManager.get().isRoomOwner) {
|
||||
// gameBinding.tvFansTeamOpt.text = "粉絲團(${initInfo.anchorFansNum})"
|
||||
// clickListener = View.OnClickListener {
|
||||
// DialogWebViewActivity.start(
|
||||
// requireContext(),
|
||||
// UriProvider.getFansTeamMyFansUrl(AvRoomDataManager.get().roomUid)
|
||||
// )
|
||||
// }
|
||||
// } else {
|
||||
// if (initInfo.isAnchorFans) {
|
||||
// gameBinding.tvFansTeamOpt.text =
|
||||
// "粉絲LV.${if (initInfo.fansLevelSeq == 0) 1 else initInfo.fansLevelSeq}"
|
||||
// clickListener = View.OnClickListener {
|
||||
// FansTeamJoinedActivity.start(requireContext())
|
||||
// }
|
||||
// } else {
|
||||
// gameBinding.tvFansTeamOpt.text = "加入粉絲團"
|
||||
// clickListener = View.OnClickListener {
|
||||
// FansTeamJoinActivity.start(requireContext())
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// if (AvRoomDataManager.get().isRoomOwner) {
|
||||
// gameBinding.tvFansTeamOpt.text = "開通粉絲團"
|
||||
// clickListener = View.OnClickListener {
|
||||
// CommonWebViewActivity.start(
|
||||
// requireContext(),
|
||||
// UriProvider.getFansTeamOpenUrl(AvRoomDataManager.get().roomUid)
|
||||
// )
|
||||
// }
|
||||
// } else {
|
||||
// gameBinding.tvFansTeamOpt.text = "該主播暫未開通粉絲團"
|
||||
// }
|
||||
// }
|
||||
// gameBinding.flFansTeam.setOnClickListener(clickListener)
|
||||
}
|
||||
|
||||
override fun onReceiveRoomEvent(roomEvent: RoomEvent?) {
|
||||
@@ -275,6 +232,11 @@ class SingleRoomFragment : BaseRoomFragment<ISingleRoomView?, SingleRoomPresente
|
||||
bottomView.setBottomViewListener(BaseRoomBottomViewWrapper())
|
||||
}
|
||||
|
||||
override fun onEnterRoom() {
|
||||
super.onEnterRoom()
|
||||
fansTeamViewModel.loadFansTeamInitInfo()
|
||||
}
|
||||
|
||||
override fun updateView() {
|
||||
super.updateView()
|
||||
if (AvRoomDataManager.get().isOpenAnotherPKMode && gameBinding.microView.adapter !is SingleRoomPKMicroViewAdapter) {
|
||||
|
@@ -5,6 +5,7 @@ import androidx.lifecycle.MutableLiveData
|
||||
import com.yizhuan.erban.base.BaseViewModel
|
||||
import com.yizhuan.xchat_android_core.bean.response.ListResult
|
||||
import com.yizhuan.xchat_android_core.fansteam.*
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
|
||||
class FansTeamViewModel : BaseViewModel() {
|
||||
@@ -37,6 +38,9 @@ class FansTeamViewModel : BaseViewModel() {
|
||||
}
|
||||
|
||||
fun loadFansTeamInitInfo() {
|
||||
if (AvRoomDataManager.get().roomUid == 0L) {
|
||||
return
|
||||
}
|
||||
safeLaunch {
|
||||
_fansTeamInitInfoLiveData.value = FansTeamModel.getFansTeamInitInfo()
|
||||
}
|
||||
|
Reference in New Issue
Block a user