fix:调整个人资料相册数据源

This commit is contained in:
max
2024-06-27 11:06:03 +08:00
parent a4f9559ad9
commit b673f5603f
3 changed files with 3 additions and 4 deletions

View File

@@ -71,7 +71,6 @@ import com.chwl.core.user.bean.UserPhoto;
import com.chwl.core.user.event.LoginUserInfoUpdateEvent;
import com.chwl.core.utils.CoreLogger;
import com.chwl.library.annatation.ActLayoutRes;
import com.zhpan.bannerview.BannerViewPager;
import com.zhpan.bannerview.constants.IndicatorGravity;
import org.greenrobot.eventbus.EventBus;

View File

@@ -9,8 +9,8 @@ import com.chwl.core.user.bean.UserDetailInfo
import com.chwl.core.user.bean.UserPhoto
class UserInfoAlbumAdapter :
BaseQuickAdapter<UserDetailInfo.DataBean.PrivatePhotoBean, BaseViewHolder>(R.layout.user_info_item_album) {
override fun convert(helper: BaseViewHolder, item: UserDetailInfo.DataBean.PrivatePhotoBean) {
BaseQuickAdapter<UserPhoto, BaseViewHolder>(R.layout.user_info_item_album) {
override fun convert(helper: BaseViewHolder, item: UserPhoto) {
val imageView = helper.getView<ImageView>(R.id.iv_image)
imageView.load(item.photoUrl)
}

View File

@@ -57,7 +57,7 @@ class UserInfoDataFragment : BaseViewBindingFragment<UserInfoDataFragmentBinding
}
showPhotoPreview(ArrayList(list), position)
}
viewModel.userInfoDetailData.observe(this) {
viewModel.userInfoData.observe(this) {
binding.tvAlbumCount.text = "(${it.privatePhoto?.size ?: 0})"
binding.tvAlbumStatus.isVisible = it.privatePhoto.isNullOrEmpty()
albumAdapter.setNewData(it.privatePhoto)