[Modify]修改礼物页面报网络错误的bug
This commit is contained in:
@@ -127,7 +127,8 @@ public class UserInfoGiftFragment extends BaseBindingFragment<FragmentUserInfoGi
|
||||
.subscribe(new BeanObserver<List<GiftWallInfo>>() {
|
||||
@Override
|
||||
public void onErrorMsg(String error) {
|
||||
onRequestGiftWallFail(error);
|
||||
Log.i("UserInfoGiftFragment:", error);
|
||||
// onRequestGiftWallFail(error);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -28,7 +28,7 @@ import com.yizhuan.xchat_android_core.statistic.StatisticManager
|
||||
import com.yizhuan.xchat_android_core.statistic.protocol.StatisticsProtocol
|
||||
import com.yizhuan.xchat_android_core.user.UserInfoUiMgr
|
||||
import com.yizhuan.xchat_android_core.user.UserModel
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserDetailInfo
|
||||
import com.yizhuan.xchat_android_core.utils.StarUtils
|
||||
import com.yizhuan.xchat_android_core.utils.net.BeanObserver
|
||||
import com.yizhuan.xchat_android_core.utils.net.DontWarnObserver
|
||||
@@ -50,30 +50,27 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
|
||||
override fun init() {
|
||||
EventBus.getDefault().register(this)
|
||||
|
||||
vm.userInfoData.observe(this) {
|
||||
initInfoData(it)
|
||||
}
|
||||
|
||||
vm.hallData.observe(this) {
|
||||
initPersonalData(it)
|
||||
}
|
||||
|
||||
vm.userInfoDetailData.observe(this) {
|
||||
initInfoData(it)
|
||||
initDynamicList(it.dynamicInfo)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun initInfoData(userInfo: UserInfo) {
|
||||
private fun initInfoData(bean: UserDetailInfo.DataBean) {
|
||||
//设置星座
|
||||
val star = StarUtils.getConstellation(Date(userInfo.birth))
|
||||
val star = StarUtils.getConstellation(Date(bean.birth))
|
||||
if (null == star) {
|
||||
binding.tvConstellation.visibility = View.GONE
|
||||
} else {
|
||||
binding.tvConstellation.text = star
|
||||
binding.tvConstellation.visibility = View.VISIBLE
|
||||
}
|
||||
val birth = TimeUtil.getDateTimeString(userInfo.birth, "yyyy-MM-dd")
|
||||
val birth = TimeUtil.getDateTimeString(bean.birth, "yyyy-MM-dd")
|
||||
binding.tvBirth.text = birth
|
||||
}
|
||||
|
||||
@@ -239,6 +236,7 @@ class UserInfoInfoFragment : BaseViewBindingFragment<FragmentUserinfoUserinfoBin
|
||||
fun onDynamicRefreshEvent(event: DynamicRefreshEvent?) {
|
||||
if (isResumed) {
|
||||
vm.userInfoDetailData.observe(this) {
|
||||
initInfoData(it)
|
||||
initDynamicList(it.dynamicInfo)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user