mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Only cluster updates of the same type together.
This commit is contained in:
committed by
Alan Evans
parent
458941f952
commit
8ef809a02b
@@ -163,10 +163,12 @@ public final class ConversationUpdateItem extends FrameLayout
|
||||
hasWallpaper);
|
||||
}
|
||||
|
||||
private static boolean shouldCollapse(@NonNull MessageRecord current, @NonNull Optional<MessageRecord> candidate) {
|
||||
private static boolean shouldCollapse(@NonNull MessageRecord current, @NonNull Optional<MessageRecord> candidate)
|
||||
{
|
||||
return candidate.isPresent() &&
|
||||
candidate.get().isUpdate() &&
|
||||
DateUtils.isSameDay(current.getTimestamp(), candidate.get().getTimestamp());
|
||||
DateUtils.isSameDay(current.getTimestamp(), candidate.get().getTimestamp()) &&
|
||||
isSameType(current, candidate.get());
|
||||
}
|
||||
|
||||
/** After a short delay, if the main data hasn't shown yet, then a loading message is displayed. */
|
||||
@@ -229,7 +231,10 @@ public final class ConversationUpdateItem extends FrameLayout
|
||||
}
|
||||
}
|
||||
|
||||
private void present(ConversationMessage conversationMessage, @NonNull Optional<MessageRecord> nextMessageRecord, @NonNull Recipient conversationRecipient) {
|
||||
private void present(@NonNull ConversationMessage conversationMessage,
|
||||
@NonNull Optional<MessageRecord> nextMessageRecord,
|
||||
@NonNull Recipient conversationRecipient)
|
||||
{
|
||||
if (batchSelected.contains(conversationMessage)) setSelected(true);
|
||||
else setSelected(false);
|
||||
|
||||
@@ -367,6 +372,13 @@ public final class ConversationUpdateItem extends FrameLayout
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isSameType(@NonNull MessageRecord current, @NonNull MessageRecord candidate) {
|
||||
return (current.isGroupUpdate() && candidate.isGroupUpdate()) ||
|
||||
(current.isProfileChange() && candidate.isProfileChange()) ||
|
||||
(current.isGroupCall() && candidate.isGroupCall()) ||
|
||||
(current.isExpirationTimerUpdate() && candidate.isExpirationTimerUpdate());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOnClickListener(View.OnClickListener l) {
|
||||
super.setOnClickListener(new InternalClickListener(l));
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
|
||||
<dimen name="review_card_icon_arc_radius">14.5dp</dimen>
|
||||
|
||||
<dimen name="conversation_update_vertical_margin">2dp</dimen>
|
||||
<dimen name="conversation_update_vertical_margin">4dp</dimen>
|
||||
<dimen name="conversation_update_vertical_padding">5dp</dimen>
|
||||
<dimen name="conversation_update_vertical_padding_collapsed">2dp</dimen>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user