Create a fun

This commit is contained in:
Benoit Marty 2020-05-05 00:30:49 +02:00
parent fcee85a682
commit db77e7b817
1 changed files with 60 additions and 51 deletions

View File

@ -64,8 +64,18 @@ class MergedHeaderItemFactory @Inject constructor(private val avatarRenderer: Av
} else if (!event.canBeMerged() || (nextEvent?.root?.getClearType() == event.root.getClearType() && !addDaySeparator)) { } else if (!event.canBeMerged() || (nextEvent?.root?.getClearType() == event.root.getClearType() && !addDaySeparator)) {
null null
} else { } else {
buildMembershipEventsMergedSummary(currentPosition, items, event, eventIdToHighlight, requestModelBuild, callback)
}
}
private fun buildMembershipEventsMergedSummary(currentPosition: Int,
items: List<TimelineEvent>,
event: TimelineEvent,
eventIdToHighlight: String?,
requestModelBuild: () -> Unit,
callback: TimelineEventController.Callback?): MergedMembershipEventsItem_? {
val prevSameTypeEvents = items.prevSameTypeEvents(currentPosition, 2) val prevSameTypeEvents = items.prevSameTypeEvents(currentPosition, 2)
if (prevSameTypeEvents.isEmpty()) { return if (prevSameTypeEvents.isEmpty()) {
null null
} else { } else {
var highlighted = false var highlighted = false
@ -119,7 +129,6 @@ class MergedHeaderItemFactory @Inject constructor(private val avatarRenderer: Av
} }
} }
} }
}
private fun buildRoomCreationMergedSummary(currentPosition: Int, private fun buildRoomCreationMergedSummary(currentPosition: Int,
items: List<TimelineEvent>, items: List<TimelineEvent>,