Commit a1fca572 authored by Amirhossein Naghshzan's avatar Amirhossein Naghshzan Committed by Adrien Béraud
Browse files

tv: update conversation adapter

Change-Id: I7bd0a6daad83277b7c0a537bfa93ec002e4376fc
parent b7ff1de9
......@@ -660,11 +660,14 @@ class TvConversationAdapter(
private fun configureForContactEvent(viewHolder: ConversationViewHolder, interaction: Interaction) {
val event = interaction as ContactEvent
if (event.event === ContactEvent.Event.ADDED) {
viewHolder.mMsgTxt?.setText(R.string.hist_contact_added)
} else if (event.event === ContactEvent.Event.INCOMING_REQUEST) {
viewHolder.mMsgTxt?.setText(R.string.hist_invitation_received)
}
viewHolder.mMsgTxt?.setText(when (event.event) {
ContactEvent.Event.ADDED -> R.string.hist_contact_added
ContactEvent.Event.INVITED -> R.string.hist_contact_invited
ContactEvent.Event.REMOVED -> R.string.hist_contact_left
ContactEvent.Event.BANNED -> R.string.hist_contact_banned
ContactEvent.Event.INCOMING_REQUEST -> R.string.hist_invitation_received
else -> R.string.hist_contact_added
})
viewHolder.compositeDisposable.add(timestampUpdateTimer.subscribe { t: Long? ->
val timeSeparationString = TextUtils.timestampToDetailString(viewHolder.itemView.context, event.timestamp)
viewHolder.mMsgDetailTxt?.text = timeSeparationString
......
Supports Markdown
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