Timeline permalink : continue to iterate (try a strategy to avoid forward insertion to "auto-scroll")

This commit is contained in:
ganfra 2024-04-23 13:30:55 +02:00
parent ff92551472
commit 0d7cffe400
25 changed files with 599 additions and 218 deletions

View file

@ -50,7 +50,7 @@ class PollHistoryPresenter @Inject constructor(
override fun present(): PollHistoryState {
// TODO use room.rememberPollHistory() when working properly?
val timeline = room.liveTimeline
val paginationState by timeline.backPaginationStatus.collectAsState()
val paginationState by timeline.paginationStatus(Timeline.PaginationDirection.BACKWARDS).collectAsState()
val pollHistoryItemsFlow = remember {
timeline.timelineItems.map { items ->
pollHistoryItemFactory.create(items)
@ -96,6 +96,6 @@ class PollHistoryPresenter @Inject constructor(
}
private fun CoroutineScope.loadMore(pollHistory: Timeline) = launch {
pollHistory.paginateBackwards()
pollHistory.paginate(Timeline.PaginationDirection.BACKWARDS)
}
}