srctree

Robin Linden parent 39a98b98 3f019eb3
Display typing notifications in the contact list as well

This replaces the status message text with "typing..." if a contact istyping. I also tried replacing the last_message text with this, but itlooked wonky there, so this will do for now!

inlinesplit
atox/src/main/kotlin/ui/contactlist/ContactAdapter.kt added: 16, removed: 7, total 9
@@ -91,12 +91,21 @@ class ContactAdapter(
} else {
resources.getText(R.string.never)
}
if (draftMessage.isNotEmpty()) {
vh.statusMessage.text = resources.getString(R.string.draft_message, draftMessage)
vh.statusMessage.setTextColor(ResourcesCompat.getColor(resources, R.color.colorAccent, null))
} else {
vh.statusMessage.text = statusMessage
vh.statusMessage.setTextColor(vh.lastMessage.currentTextColor)
when {
typing -> {
vh.statusMessage.text = resources.getString(R.string.contact_typing)
vh.statusMessage.setTextColor(vh.lastMessage.currentTextColor)
}
draftMessage.isNotEmpty() -> {
vh.statusMessage.text = resources.getString(R.string.draft_message, draftMessage)
vh.statusMessage.setTextColor(
ResourcesCompat.getColor(resources, R.color.colorAccent, null)
)
}
else -> {
vh.statusMessage.text = statusMessage
vh.statusMessage.setTextColor(vh.lastMessage.currentTextColor)
}
}
vh.status.setColorFilter(colorByStatus(resources, this))
setAvatarFromContact(vh.image, this)