Commit 03a7efa7 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update ChatListAdapter.kt

parent 64c8f2a1
...@@ -22,7 +22,7 @@ class ChatListAdapter(private var dataSet: MutableList<Chat>, private val contex ...@@ -22,7 +22,7 @@ class ChatListAdapter(private var dataSet: MutableList<Chat>, private val contex
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val chat = dataSet[position] val chat = dataSet[position]
holder.userAvatar.setImageURI(chat.userAvatarUri) holder.userAvatar.setImageURI(chat.user.avatarUri)
holder.chatName.text = chat.name holder.chatName.text = chat.name
holder.lastMessage.text = chat.lastMessage holder.lastMessage.text = chat.lastMessage
holder.lastMessageDateTime.text = DateTimeHelper.getDate(chat.lastMessageDateTime, context) holder.lastMessageDateTime.text = DateTimeHelper.getDate(chat.lastMessageDateTime, context)
...@@ -31,7 +31,7 @@ class ChatListAdapter(private var dataSet: MutableList<Chat>, private val contex ...@@ -31,7 +31,7 @@ class ChatListAdapter(private var dataSet: MutableList<Chat>, private val contex
"p" -> DrawableHelper.compoundDrawable(holder.chatName, DrawableHelper.getDrawableFromId(R.drawable.ic_lock_outline_black, context)) "p" -> DrawableHelper.compoundDrawable(holder.chatName, DrawableHelper.getDrawableFromId(R.drawable.ic_lock_outline_black, context))
"c" -> DrawableHelper.compoundDrawable(holder.chatName, DrawableHelper.getDrawableFromId(R.drawable.ic_hashtag_black, context)) "c" -> DrawableHelper.compoundDrawable(holder.chatName, DrawableHelper.getDrawableFromId(R.drawable.ic_hashtag_black, context))
"d" -> { "d" -> {
val userStatus = chat.userStatus val userStatus = chat.user.status
if (userStatus != null) { if (userStatus != null) {
DrawableHelper.compoundDrawable(holder.chatName, DrawableHelper.getUserStatusDrawable(userStatus, context)) DrawableHelper.compoundDrawable(holder.chatName, DrawableHelper.getUserStatusDrawable(userStatus, context))
} }
......
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