fix: 修复个人界面头像显示错误问题

This commit is contained in:
糕小菜 2024-12-12 16:34:15 +08:00
parent 3c899768d7
commit a25f00f0bc

View File

@ -14,8 +14,6 @@ import com.kaixed.kchat.ui.base.BaseFragment
import com.kaixed.kchat.utils.ConstantsUtil
import com.kaixed.kchat.utils.ConstantsUtil.getAvatarUrl
import com.kaixed.kchat.utils.ConstantsUtil.getUsername
import com.kaixed.kchat.utils.TextUtil
import org.greenrobot.eventbus.EventBus
class MineFragment : BaseFragment<FragmentMineBinding>() {
@ -51,8 +49,7 @@ class MineFragment : BaseFragment<FragmentMineBinding>() {
binding.tvNickname.text = nickname
val kid = "kid: ${getUsername()}"
binding.tvId.text = kid
val avatarUrl = TextUtil.extractDimensionsAndPrefix(getAvatarUrl())?.first
Glide.with(requireContext()).load(avatarUrl)
Glide.with(requireContext()).load(getAvatarUrl())
.placeholder(R.drawable.ic_default_avatar)
.error(R.drawable.ic_default_avatar)
.into(binding.ifvAvatar)