Skip to content
Snippets Groups Projects
Commit edd7cdb3 authored by Amirhossein Naghshzan's avatar Amirhossein Naghshzan Committed by Adrien Béraud
Browse files

conversation: load contact profile picture

Change-Id: I33346db4e0384dbe5746af9961f93fb2404b83ea
parent b70b0b1f
No related branches found
No related tags found
No related merge requests found
......@@ -211,7 +211,7 @@ class ConversationAdapter(
* Updates the contact photo to use for this conversation
*/
fun setPhoto() {
//notifyDataSetChanged()
notifyDataSetChanged()
}
override fun getItemCount(): Int {
......
......@@ -864,17 +864,15 @@ class ConversationFragment : BaseSupportFragment<ConversationPresenter, Conversa
mParticipantAvatars[contactKey]!!.update(contact)
mAdapter?.setPhoto()
} else {
mCompositeDisposable.add(AvatarFactory.getAvatar(requireContext(), contact, true)
.observeOn(AndroidSchedulers.mainThread())
.subscribe { avatar ->
mParticipantAvatars[contactKey] = avatar as AvatarDrawable
mSmallParticipantAvatars[contactKey] = AvatarDrawable.Builder()
.withContact(contact)
.withCircleCrop(true)
.withPresence(false)
.build(requireContext())
mAdapter?.setPhoto()
})
val builder = AvatarDrawable.Builder()
.withContact(contact)
.withCircleCrop(true)
mParticipantAvatars[contactKey] = builder
.withPresence(true)
.build(requireContext())
mSmallParticipantAvatars[contactKey] = builder
.withPresence(false)
.build(requireContext())
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment