[Modify]viewModel的错误提示修改
This commit is contained in:
@@ -16,8 +16,8 @@ class DecorationViewModel : BaseViewModel() {
|
||||
|
||||
private val BANNER_TYPE = "3"
|
||||
|
||||
private val _bannerLiveData = MutableLiveData<List<BannerInfo>>()
|
||||
val bannerLiveData: LiveData<List<BannerInfo>> = _bannerLiveData
|
||||
private val _bannerLiveData = MutableLiveData<List<BannerInfo>?>()
|
||||
val bannerLiveData: MutableLiveData<List<BannerInfo>?> = _bannerLiveData
|
||||
|
||||
private val _decorationInfoListLiveData = MutableLiveData<ListResult<DecorationInfo>>()
|
||||
val decorationInfoListLiveData: LiveData<ListResult<DecorationInfo>> =
|
||||
@@ -31,9 +31,6 @@ class DecorationViewModel : BaseViewModel() {
|
||||
safeLaunch(
|
||||
block = {
|
||||
_bannerLiveData.value = HomeModel.getHomeBanner(BANNER_TYPE)
|
||||
},
|
||||
onError = {
|
||||
_bannerLiveData.value = null
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -45,6 +42,7 @@ class DecorationViewModel : BaseViewModel() {
|
||||
ListResult.success(DecorationModel.getDecorationInfoList(dressType), 1)
|
||||
},
|
||||
onError = {
|
||||
it.message.toast()
|
||||
_decorationInfoListLiveData.value = ListResult.failed(1)
|
||||
}
|
||||
)
|
||||
|
@@ -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.utils.toast
|
||||
|
||||
class FansTeamViewModel : BaseViewModel() {
|
||||
|
||||
@@ -51,6 +52,7 @@ class FansTeamViewModel : BaseViewModel() {
|
||||
fun loadJoinFansTeamList(pageNum: Int, pageSize: Int) {
|
||||
safeLaunch(
|
||||
onError = {
|
||||
it.message.toast()
|
||||
_joinFansTeamListLiveData.value = ListResult.failed(pageNum)
|
||||
},
|
||||
block = {
|
||||
|
@@ -93,6 +93,7 @@ class HomeViewModel : BaseViewModel() {
|
||||
fun getGameRoom(pageNum: Int, pageSize: Int) {
|
||||
safeLaunch(
|
||||
onError = {
|
||||
it.message.toast()
|
||||
_gameRoomLiveData.value = ListResult.failed(pageNum)
|
||||
},
|
||||
block = {
|
||||
|
@@ -6,6 +6,7 @@ import com.yizhuan.erban.base.BaseViewModel
|
||||
import com.yizhuan.xchat_android_core.bean.response.ListResult
|
||||
import com.yizhuan.xchat_android_core.home.bean.HomeRoomInfo
|
||||
import com.yizhuan.xchat_android_core.home.model.HomeModel
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
|
||||
class RoomCommonViewModel : BaseViewModel() {
|
||||
|
||||
@@ -15,6 +16,7 @@ class RoomCommonViewModel : BaseViewModel() {
|
||||
fun getCommonRoom(tabId: Int, pageNum: Int, pageSize: Int) {
|
||||
safeLaunch(
|
||||
onError = {
|
||||
it.message.toast()
|
||||
_commonRoomLiveData.value = ListResult.failed(pageNum)
|
||||
},
|
||||
block = {
|
||||
|
@@ -110,17 +110,13 @@ public class SquareFragment extends BaseFragment implements TopMagicIndicatorAda
|
||||
viewPager.addOnPageChangeListener(new OnPageSelectedListener() {
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
String tag = "";
|
||||
if(position == 0){
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_SQUARE_DONGTAI_FOLLOW_CLICK,
|
||||
ResUtil.getString(R.string.community_square_squarefragment_01));
|
||||
tag = getResources().getString(R.string.dys_tab_attent);
|
||||
}else if (position == 1){
|
||||
tag = getResources().getString(R.string.dys_tab_recommend);
|
||||
} else if (position == 2){
|
||||
StatisticManager.Instance().onEvent(StatisticsProtocol.EVENT_SQUARE_DONGTAI_NEW_CLICK,
|
||||
ResUtil.getString(R.string.community_square_squarefragment_02));
|
||||
tag = getResources().getString(R.string.dys_tab_new);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user