Commit 80df920e authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Mutate drawable before tinting it.

parent 15a317a4
......@@ -23,7 +23,6 @@ import chat.rocket.android.util.extensions.inflate
import chat.rocket.android.util.extensions.setVisible
import chat.rocket.android.util.extensions.textContent
import chat.rocket.common.model.RoomType
import chat.rocket.common.model.UserStatus
import chat.rocket.core.model.ChatRoom
import com.facebook.drawee.view.SimpleDraweeView
import kotlinx.android.synthetic.main.item_chat.view.*
......@@ -101,15 +100,15 @@ class ChatRoomsAdapter(private val context: Context,
else -> null
}
drawable?.let {
val mutateDrawable = DrawableHelper.wrapDrawable(it).mutate()
if (chatRoom.type !is RoomType.DirectMessage) {
DrawableHelper.wrapDrawable(it)
val color = when (chatRoom.alert || chatRoom.unread > 0) {
true -> R.color.colorPrimaryText
false -> R.color.colorSecondaryText
}
DrawableHelper.tintDrawable(it, context, color)
DrawableHelper.tintDrawable(mutateDrawable, context, color)
}
imageView.setImageDrawable(drawable)
imageView.setImageDrawable(mutateDrawable)
}
}
......
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