操作密码
This commit is contained in:
@@ -8,6 +8,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Toast
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.example.defenseapplication.R
|
||||
import com.example.defenseapplication.bean.UserInfoBean
|
||||
import com.example.defenseapplication.databinding.PersonalFragmentBinding
|
||||
@@ -203,8 +204,13 @@ class PersonalFragment : Fragment() {
|
||||
binding.tvPhone.text = it
|
||||
}
|
||||
userInfo.avatar?.let {
|
||||
val requestOptions = RequestOptions()
|
||||
.placeholder(R.drawable.img) // 加载中显示
|
||||
.error(R.drawable.img) // 失败时显示
|
||||
|
||||
Glide.with(this)
|
||||
.load(it)
|
||||
.load(it) // 如果 avatar 为 null,Glide 会直接回调 error
|
||||
.apply(requestOptions)
|
||||
.circleCrop()
|
||||
.into(binding.ivAvatar)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user