[Modify]优化项目的警告
This commit is contained in:
@@ -47,7 +47,7 @@ class AssociationFragment : BaseViewBindingFragment<FragmentAssociationBinding>(
|
||||
ModuleClanActivity.start(context, info.clanElderUid)
|
||||
}
|
||||
}
|
||||
associationAdapter.setOnItemChildClickListener { adapter, view, position ->
|
||||
associationAdapter.setOnItemChildClickListener { _, _, position ->
|
||||
val bean = associationAdapter.getItem(position)
|
||||
bean?.let {
|
||||
if(it.applyBtnStatus == 2){
|
||||
|
@@ -73,7 +73,7 @@ class AssociationRoomFragment : BaseViewBindingFragment<FragmentAssociationRoomB
|
||||
}
|
||||
}
|
||||
})
|
||||
binding.etSearch.setOnEditorActionListener(TextView.OnEditorActionListener { v, actionId, event -> //以下方法防止两次发送请求
|
||||
binding.etSearch.setOnEditorActionListener(TextView.OnEditorActionListener { _, actionId, event -> //以下方法防止两次发送请求
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH && event != null || event != null && event.keyCode == KeyEvent.KEYCODE_ENTER) {
|
||||
if (event.action == KeyEvent.ACTION_UP) { //发送请求
|
||||
val newStr: String = binding.etSearch.text.toString().trim { it <= ' ' }
|
||||
|
@@ -152,7 +152,7 @@ class ExitRoomPopupWindow(val avRoomActivity: AVRoomActivity) : PopupWindow() {
|
||||
@SuppressLint("CheckResult")
|
||||
override fun onOk() {
|
||||
avRoomActivity.giveUpDragonBar()
|
||||
.subscribe { s: String? ->
|
||||
.subscribe { _: String? ->
|
||||
HomePartyPresenter().cancelDragon()
|
||||
avRoomActivity.toBack()
|
||||
}
|
||||
|
@@ -36,7 +36,6 @@ import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.avroom.BottomViewListenerWrapper
|
||||
import com.yizhuan.erban.avroom.SoftKeyBoardListener
|
||||
import com.yizhuan.erban.avroom.SoftKeyBoardListener.OnSoftKeyBoardChangeListener
|
||||
import com.yizhuan.erban.avroom.activity.AVRoomActivity
|
||||
import com.yizhuan.erban.avroom.activity.RoomInviteActivity
|
||||
import com.yizhuan.erban.avroom.activity.RoomTitleEditActivity
|
||||
import com.yizhuan.erban.avroom.adapter.OnMicroItemClickListener
|
||||
@@ -326,10 +325,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
GiftValueMrg.get().updateRoomGiftValue(false)
|
||||
}
|
||||
RoomEvent.ADD_BLACK_LIST -> onChatRoomMemberBlackAdd(roomEvent.account)
|
||||
RoomEvent.MIC_QUEUE_STATE_CHANGE -> onQueueMicStateChange(
|
||||
roomEvent.micPosition,
|
||||
roomEvent.posState
|
||||
)
|
||||
RoomEvent.MIC_QUEUE_STATE_CHANGE -> onQueueMicStateChange()
|
||||
RoomEvent.KICK_DOWN_MIC_BY_S_ADMIN, RoomEvent.KICK_DOWN_MIC -> if (event == RoomEvent.KICK_DOWN_MIC) {
|
||||
SingleToastUtil.showToast(
|
||||
mContext.resources.getString(
|
||||
@@ -344,10 +340,10 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
)
|
||||
}
|
||||
RoomEvent.DOWN_MIC -> {
|
||||
onDownMicro(roomEvent.micPosition)
|
||||
onDownMicro()
|
||||
}
|
||||
RoomEvent.UP_MIC -> {
|
||||
onUpMicro(roomEvent.micPosition)
|
||||
onUpMicro()
|
||||
}
|
||||
RoomEvent.INVITE_UP_MIC -> if (AvRoomDataManager.get().isOwner(roomEvent.account)) {
|
||||
//自己的消息
|
||||
@@ -440,7 +436,8 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
// 只有一個圖標,隱藏底部指示器
|
||||
val show = dialogInfo.size > 1
|
||||
rollPagerView.setHintView(object : ColorPointHintView(
|
||||
mContext, Color.WHITE, mContext.resources.getColor(
|
||||
mContext, Color.WHITE, ContextCompat.getColor(
|
||||
mContext,
|
||||
R.color.color_66FFFFFF
|
||||
)
|
||||
) {
|
||||
@@ -460,7 +457,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
|
||||
override fun makeNormalDrawable(): Drawable? {
|
||||
val dotNormal = GradientDrawable()
|
||||
dotNormal.setColor(mContext.resources.getColor(R.color.color_66FFFFFF))
|
||||
dotNormal.setColor(ContextCompat.getColor(mContext, R.color.color_66FFFFFF))
|
||||
dotNormal.cornerRadius = Util.dip2px(
|
||||
context, 2f
|
||||
).toFloat()
|
||||
@@ -741,7 +738,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
}
|
||||
}
|
||||
|
||||
private fun onUpMicro(micPosition: Int) {
|
||||
private fun onUpMicro() {
|
||||
showBottomViewForDifRole()
|
||||
updateMicBtn()
|
||||
microView.adapter.notifyDataSetChanged()
|
||||
@@ -756,7 +753,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
}
|
||||
}
|
||||
|
||||
private fun onDownMicro(micPosition: Int) {
|
||||
private fun onDownMicro() {
|
||||
showBottomViewForDifRole()
|
||||
updateMicBtn()
|
||||
microView.adapter.notifyDataSetChanged()
|
||||
@@ -764,7 +761,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
GiftValueMrg.get().updateRoomGiftValue(false)
|
||||
}
|
||||
|
||||
private fun onQueueMicStateChange(micPosition: Int, micPosState: Int) {
|
||||
private fun onQueueMicStateChange() {
|
||||
microView.adapter.notifyDataSetChanged()
|
||||
onMicStateChanged()
|
||||
}
|
||||
@@ -866,7 +863,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
}
|
||||
|
||||
override fun chatRoomReConnectView() {
|
||||
if (microView != null && microView.adapter != null) microView.adapter.notifyDataSetChanged()
|
||||
if (microView.adapter != null) microView.adapter.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
override fun onAvatarBtnClick(position: Int) {
|
||||
@@ -1027,7 +1024,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
} else {
|
||||
toast("請給予麥克風權限後再試!")
|
||||
}
|
||||
}, { throwable: Throwable? -> toast("發生一些異常,請稍後重試!") })
|
||||
}, { _: Throwable? -> toast("發生一些異常,請稍後重試!") })
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1036,7 +1033,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
* @return
|
||||
*/
|
||||
private val isHavingMicPermissions: Boolean
|
||||
private get() = ContextCompat.checkSelfPermission(
|
||||
get() = ContextCompat.checkSelfPermission(
|
||||
mContext,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
) == PackageManager.PERMISSION_GRANTED
|
||||
@@ -1268,7 +1265,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
if (AvRoomDataManager.get().isOnMic(myUid) || AvRoomDataManager.get().isRoomOwner) {
|
||||
if (dynamicFaceDialog == null) {
|
||||
dynamicFaceDialog = DynamicFaceDialog(context)
|
||||
dynamicFaceDialog?.setOnDismissListener { dialog: DialogInterface? ->
|
||||
dynamicFaceDialog?.setOnDismissListener { _: DialogInterface? ->
|
||||
dynamicFaceDialog = null
|
||||
}
|
||||
}
|
||||
|
@@ -393,7 +393,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
|
||||
when (state) {
|
||||
SudMGPMGState.MG_COMMON_PLAYER_IN -> handlePlayerIn(userId, dataJson)
|
||||
SudMGPMGState.MG_COMMON_PLAYER_READY -> handlePlayerReady(userId, dataJson)
|
||||
SudMGPMGState.MG_COMMON_PLAYER_CAPTAIN -> handlePlayerCaptain(userId, dataJson)
|
||||
SudMGPMGState.MG_COMMON_PLAYER_CAPTAIN -> handlePlayerCaptain(dataJson)
|
||||
SudMGPMGState.MG_COMMON_PLAYER_PLAYING -> handlePlayerPlaying(userId, dataJson)
|
||||
}
|
||||
}
|
||||
@@ -409,10 +409,6 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
|
||||
return
|
||||
}
|
||||
if (isIn) { // 已加入
|
||||
var teamId = 0
|
||||
if (jsonObject.has("teamId")) {
|
||||
teamId = jsonObject.getInt("teamId")
|
||||
}
|
||||
if (AvRoomDataManager.get().isRoomOwner) {
|
||||
notifySelfCaptainState(mUid)
|
||||
}
|
||||
@@ -480,11 +476,10 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
|
||||
}
|
||||
}
|
||||
|
||||
private fun handlePlayerCaptain(userId: String, dataJson: String) {
|
||||
private fun handlePlayerCaptain(dataJson: String) {
|
||||
try {
|
||||
val jsonObject = JSONObject(dataJson)
|
||||
val retCode = jsonObject.getInt("retCode")
|
||||
val isCaptain = jsonObject.getBoolean("isCaptain")
|
||||
if (retCode != 0) {
|
||||
return
|
||||
}
|
||||
|
@@ -145,7 +145,7 @@ class RedPackageOpenDialog : BaseDialog<DialogRedPackageOpenBinding>() {
|
||||
binding.tvDiamondNum.text = it.amount.substringBefore(".")
|
||||
}
|
||||
if (!AvRoomDataManager.get().isRoomFans){
|
||||
AvRoomDataManager.get().roomUid?.let {
|
||||
AvRoomDataManager.get().roomUid.let {
|
||||
CollectionRoomModel.get().followRoom("1", it)
|
||||
.subscribe { _: String? ->
|
||||
AvRoomDataManager.get().isRoomFans = true
|
||||
|
@@ -181,7 +181,7 @@ class RedPackageSendDialog : BaseDialog<DialogRedPackageSendBinding>(), GridPass
|
||||
SingleToastUtil.showToast("單個紅包金額過低")
|
||||
return@setOnClickListener
|
||||
}
|
||||
GiveGoldPassWordFragment.newInstance(requireFragmentManager(), binding.editGoldNum.text.toString()).apply {
|
||||
GiveGoldPassWordFragment.newInstance(childFragmentManager, binding.editGoldNum.text.toString()).apply {
|
||||
setListener(this@RedPackageSendDialog)
|
||||
passWordFragment = this
|
||||
}
|
||||
|
@@ -5,11 +5,12 @@ import androidx.lifecycle.MutableLiveData
|
||||
import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.base.BaseViewModel
|
||||
import com.yizhuan.xchat_android_core.bean.response.ListResult
|
||||
import com.yizhuan.xchat_android_core.home.bean.*
|
||||
import com.yizhuan.xchat_android_core.home.bean.BannerInfo
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeTabMapInfo
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeTagInfo
|
||||
import com.yizhuan.xchat_android_core.home.model.HomeModel
|
||||
import com.yizhuan.xchat_android_core.room.bean.AnchorInfo
|
||||
import com.yizhuan.xchat_android_core.room.bean.HomeLiveTopInfo
|
||||
import com.yizhuan.xchat_android_core.room.bean.SingleRoomSortInfo
|
||||
import com.yizhuan.xchat_android_core.statistic.StatisticManager
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
@@ -25,9 +26,6 @@ class HomeViewModel : BaseViewModel() {
|
||||
private val _bannerLiveData = MutableLiveData<List<BannerInfo>?>()
|
||||
val bannerLiveData: MutableLiveData<List<BannerInfo>?> = _bannerLiveData
|
||||
|
||||
private val _hotRoomLiveData = MutableLiveData<ListResult<HomeRoomInfo>>()
|
||||
val hotRoomLiveData: LiveData<ListResult<HomeRoomInfo>> = _hotRoomLiveData
|
||||
|
||||
private val _gameRoomLiveData = MutableLiveData<ListResult<HomeRoomInfo>>()
|
||||
val gameRoomLiveData: LiveData<ListResult<HomeRoomInfo>> = _gameRoomLiveData
|
||||
|
||||
@@ -49,18 +47,11 @@ class HomeViewModel : BaseViewModel() {
|
||||
private val _emptyLiveData = MutableLiveData<Boolean>()
|
||||
val emptyLiveData: LiveData<Boolean> = _emptyLiveData
|
||||
|
||||
private val _singleRoomSortInfoLiveData = MutableLiveData<ListResult<SingleRoomSortInfo>>()
|
||||
val singleRoomSortInfoLiveData: LiveData<ListResult<SingleRoomSortInfo>> =
|
||||
_singleRoomSortInfoLiveData
|
||||
|
||||
private val _homeLiveTopInfoLiveData = MutableLiveData<HomeLiveTopInfo?>()
|
||||
val homeLiveTopInfoLiveData: MutableLiveData<HomeLiveTopInfo?> = _homeLiveTopInfoLiveData
|
||||
|
||||
private val _anchorInfoLiveData = MutableLiveData<AnchorInfo?>()
|
||||
val anchorInfoLiveData: MutableLiveData<AnchorInfo?> = _anchorInfoLiveData
|
||||
|
||||
private val _homePlayInfoLiveData = MutableLiveData<List<HomeRoomInfo>?>()
|
||||
val homePlayInfoData : MutableLiveData<List<HomeRoomInfo>?> = _homePlayInfoLiveData
|
||||
val homePlayInfoData: MutableLiveData<List<HomeRoomInfo>?> = _homePlayInfoLiveData
|
||||
|
||||
private val _homeHotRoomLiveData = MutableLiveData<List<HomeRoomInfo>?>()
|
||||
val homeHotRoomLiveData: LiveData<List<HomeRoomInfo>?> = _homeHotRoomLiveData
|
||||
@@ -93,19 +84,6 @@ class HomeViewModel : BaseViewModel() {
|
||||
}
|
||||
}
|
||||
|
||||
fun getHotRoom(pageNum: Int, pageSize: Int) {
|
||||
safeLaunch(
|
||||
onError = {
|
||||
_hotRoomLiveData.value = ListResult.failed(pageNum)
|
||||
},
|
||||
block = {
|
||||
val result = HomeModel.getHotRoom()
|
||||
_hotRoomLiveData.value = ListResult.success(result, pageNum)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
fun getGameRoom(pageNum: Int, pageSize: Int) {
|
||||
safeLaunch(
|
||||
onError = {
|
||||
@@ -163,7 +141,8 @@ class HomeViewModel : BaseViewModel() {
|
||||
null
|
||||
}
|
||||
}
|
||||
_concernsLiveData.value = concernsRooms.await()
|
||||
val data = concernsRooms.await()
|
||||
data?.let { _concernsLiveData.value = it }
|
||||
val collectList = collectRooms.await()
|
||||
if (collectList == null) {
|
||||
_collectLiveData.value = ListResult.failed(pageNum)
|
||||
@@ -182,34 +161,6 @@ class HomeViewModel : BaseViewModel() {
|
||||
)
|
||||
}
|
||||
|
||||
fun requestSingleRoomSortList() {
|
||||
safeLaunch(
|
||||
onError = {
|
||||
//保证最少有一个推荐tab,防止出现空白页
|
||||
_singleRoomSortInfoLiveData.value =
|
||||
ListResult.success(listOf(SingleRoomSortInfo(null, ResUtil.getString(R.string.erban_home_homeviewmodel_02))), 1)
|
||||
},
|
||||
block = {
|
||||
val result = HomeModel.requestSingleRoomSortList()
|
||||
val fullResult = ArrayList<SingleRoomSortInfo>()
|
||||
fullResult.add(SingleRoomSortInfo(null, ResUtil.getString(R.string.erban_home_homeviewmodel_03)))
|
||||
result?.let { fullResult.addAll(it) }
|
||||
_singleRoomSortInfoLiveData.value = ListResult.success(fullResult, 1)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun requestHomeLiveTopInfo() {
|
||||
safeLaunch(
|
||||
onError = {
|
||||
_homeLiveTopInfoLiveData.value = null
|
||||
},
|
||||
block = {
|
||||
_homeLiveTopInfoLiveData.value = HomeModel.requestHomeLiveTopInfo()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun requestAnchorInfo() {
|
||||
safeLaunch(
|
||||
onError = {
|
||||
|
@@ -1060,7 +1060,6 @@ public class DynamicDetailActivity extends BaseActivity implements IEmoticonSele
|
||||
}
|
||||
listBean.getReplyInfo().setLeftCount(newLeftCount);
|
||||
adapter.notifyItemChanged(replyPosition + 1);
|
||||
rvListComment.setHasFixedSize(true);
|
||||
if (bean != null) {
|
||||
bean.setCommentCount(bean.getCommentCount() + 1);
|
||||
updateCommentCount();
|
||||
@@ -1080,8 +1079,6 @@ public class DynamicDetailActivity extends BaseActivity implements IEmoticonSele
|
||||
oldReplyList.addAll(newReplyInfo.getReplyList());
|
||||
}
|
||||
adapter.notifyItemChanged(groupPosition + 1);
|
||||
rvListComment.setHasFixedSize(true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user