Timeline

interface Timeline

This is an abstraction for a timeline. Call init first!

Functions

Link copied to clipboard
abstract suspend fun init(startFrom: EventId): List<Flow<TimelineEvent>>

Initialize the timeline with the start event.

Link copied to clipboard
abstract suspend fun loadAfter(): List<Flow<TimelineEvent>>

Load new events after the newest event. This may suspend until at least one event can be loaded.

Link copied to clipboard
abstract suspend fun loadBefore(): List<Flow<TimelineEvent>>

Load new events before the oldest event. This may suspend until at least one event can be loaded.

Properties

Link copied to clipboard
abstract val canLoadAfter: Flow<Boolean>

Is true until last known TimelineEvent is reached.

Link copied to clipboard
abstract val canLoadBefore: Flow<Boolean>

Is true until start of timeline is reached.

Link copied to clipboard
abstract val events: Flow<List<Flow<TimelineEvent>>>

TimelineEvents sorted with higher indexes being more recent.

Link copied to clipboard
abstract val isInitialized: Flow<Boolean>

True when timeline initialization has been finished.

Link copied to clipboard
abstract val isLoadingAfter: Flow<Boolean>

True while events are loaded after.

Link copied to clipboard
abstract val isLoadingBefore: Flow<Boolean>

True while events are loaded before.

Link copied to clipboard
abstract val lastLoadedEventIdAfter: Flow<EventId?>

Upper bound of loaded events in this timeline.

Link copied to clipboard
abstract val lastLoadedEventIdBefore: Flow<EventId?>

Lower bound of loaded events in this timeline.

Inheritors

Link copied to clipboard