Skip to content
Snippets Groups Projects
Commit b292b4cc authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

conversations: fix time-group sequence break

Change-Id: If745fbeacf582d8331ee64809eee0d7a42410045
parent 93b7516d
Branches
Tags
No related merge requests found
......@@ -939,7 +939,7 @@ public class ConversationAdapter extends RecyclerView.Adapter<ConversationViewHo
}
Interaction nextMsg = getNextMessageFromPosition(i);
if (nextMsg != null) {
if (isSeqBreak(msg, nextMsg)) {
if (isSeqBreak(msg, nextMsg) || hasPermanentTimeString(nextMsg, i + 1)) {
return SequenceType.SINGLE;
} else {
return SequenceType.FIRST;
......@@ -958,12 +958,13 @@ public class ConversationAdapter extends RecyclerView.Adapter<ConversationViewHo
Interaction prevMsg = getPreviousMessageFromPosition(i);
Interaction nextMsg = getNextMessageFromPosition(i);
if (prevMsg != null && nextMsg != null) {
if (((isSeqBreak(msg, prevMsg) || isTimeShown) && !isSeqBreak(msg, nextMsg))) {
boolean nextMsgHasTime = hasPermanentTimeString(nextMsg, i + 1);
if (((isSeqBreak(msg, prevMsg) || isTimeShown) && !(isSeqBreak(msg, nextMsg) || nextMsgHasTime))) {
return SequenceType.FIRST;
} else if (!isSeqBreak(msg, prevMsg) && !isTimeShown && isSeqBreak(msg, nextMsg)) {
return SequenceType.LAST;
} else if (!isSeqBreak(msg, prevMsg) && !isTimeShown && !isSeqBreak(msg, nextMsg)) {
return SequenceType.MIDDLE;
return nextMsgHasTime ? SequenceType.LAST : SequenceType.MIDDLE;
}
}
return SequenceType.SINGLE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment