Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -660,11 +660,14 @@ class TvConversationAdapter( ...@@ -660,11 +660,14 @@ class TvConversationAdapter(
private fun configureForContactEvent(viewHolder: ConversationViewHolder, interaction: Interaction) { private fun configureForContactEvent(viewHolder: ConversationViewHolder, interaction: Interaction) {
val event = interaction as ContactEvent val event = interaction as ContactEvent
if (event.event === ContactEvent.Event.ADDED) { viewHolder.mMsgTxt?.setText(when (event.event) {
viewHolder.mMsgTxt?.setText(R.string.hist_contact_added) ContactEvent.Event.ADDED -> R.string.hist_contact_added
} else if (event.event === ContactEvent.Event.INCOMING_REQUEST) { ContactEvent.Event.INVITED -> R.string.hist_contact_invited
viewHolder.mMsgTxt?.setText(R.string.hist_invitation_received) 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? -> viewHolder.compositeDisposable.add(timestampUpdateTimer.subscribe { t: Long? ->
val timeSeparationString = TextUtils.timestampToDetailString(viewHolder.itemView.context, event.timestamp) val timeSeparationString = TextUtils.timestampToDetailString(viewHolder.itemView.context, event.timestamp)
viewHolder.mMsgDetailTxt?.text = timeSeparationString viewHolder.mMsgDetailTxt?.text = timeSeparationString
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment