Commit 7cd40441 authored by Leonardo Aramaki's avatar Leonardo Aramaki

A bit of refactoring

parent a739a997
...@@ -132,13 +132,15 @@ class PinnedMessagesAdapter(private val serverUrl: String) : RecyclerView.Adapte ...@@ -132,13 +132,15 @@ class PinnedMessagesAdapter(private val serverUrl: String) : RecyclerView.Adapte
} }
} }
private fun bindUserAvatar(message: MessageViewModel, drawee: SimpleDraweeView, imageUnknownAvatar: ImageView) = message.getAvatarUrl(serverUrl).let { private fun bindUserAvatar(message: MessageViewModel, drawee: SimpleDraweeView, imageUnknownAvatar: ImageView) {
drawee.setImageURI(it.toString()) message.getAvatarUrl(serverUrl).let {
drawee.setVisible(true) drawee.setImageURI(it.toString())
imageUnknownAvatar.setVisible(false) drawee.setVisible(true)
}.ifNull { imageUnknownAvatar.setVisible(false)
drawee.setVisible(false) }.ifNull {
imageUnknownAvatar.setVisible(true) drawee.setVisible(false)
imageUnknownAvatar.setVisible(true)
}
} }
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment