Commit e56d0b60 authored by Shailesh Baldaniya's avatar Shailesh Baldaniya

fix: Mutate drawable for not sharing state

parent 2188241b
......@@ -91,9 +91,10 @@ class ChatRoomActivity : AppCompatActivity(), HasSupportFragmentInjector {
}
drawable?.let {
DrawableHelper.wrapDrawable(it)
DrawableHelper.tintDrawable(it, this, R.color.white)
DrawableHelper.compoundDrawable(text_room_name, it)
val wrappedDrawable = DrawableHelper.wrapDrawable(it)
val mutableDrawable = wrappedDrawable.mutate()
DrawableHelper.tintDrawable(mutableDrawable, this, R.color.white)
DrawableHelper.compoundDrawable(text_room_name, mutableDrawable)
}
toolbar.setNavigationOnClickListener {
......
......@@ -87,13 +87,14 @@ class ChatRoomsAdapter(private val context: Context,
}
drawable?.let {
DrawableHelper.wrapDrawable(it)
DrawableHelper.tintDrawable(it, context,
val wrappedDrawable = DrawableHelper.wrapDrawable(it)
val mutableDrawable = wrappedDrawable.mutate()
DrawableHelper.tintDrawable(mutableDrawable, context,
when (chatRoom.alert || chatRoom.unread > 0) {
true -> R.color.colorPrimaryText
false -> R.color.colorSecondaryText
})
DrawableHelper.compoundDrawable(textView, it)
DrawableHelper.compoundDrawable(textView, mutableDrawable)
}
}
......
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