Skip to content
Snippets Groups Projects
Commit b82d30d1 authored by Pierre Nicolas's avatar Pierre Nicolas :joy:
Browse files

chatview: add message separation util method

Tells if message separation is meeded.

Change-Id: If17e767b3469d77f3e5edc8a2a84a5df6bcb50a3
parent ae0f7726
No related branches found
No related tags found
No related merge requests found
......@@ -1474,6 +1474,20 @@ class ConversationAdapter(
}
}
/**
* Message Separation is used to highlight two group of messages.
* We don't need message separation if:
* - The message is the first of the conversation
* - The message is the first of the day (date already shown)
*/
private fun isMessageSeparationNeeded(
isDateShown: Boolean,
messagePosition: Int,
): Boolean = getPreviousInteractionFromPosition(messagePosition)?.let { firstInteraction ->
val secondInteraction = mInteractions[messagePosition]
!isDateShown && isSeqBreak(firstInteraction, secondInteraction)
} ?: false
/**
* Configures the viewHolder to display a call info text message, ie. not a classic text message
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment