mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 18:35:40 +03:00
Timeline: update when loading states changed
This commit is contained in:
parent
3d31ba963d
commit
03961fe933
2 changed files with 9 additions and 1 deletions
|
@ -95,7 +95,7 @@ interface Timeline {
|
|||
*/
|
||||
fun onNewTimelineEvents(eventIds: List<String>)
|
||||
|
||||
fun onStateUpdated() = Unit
|
||||
fun onStateUpdated(direction: Direction, state: PaginationState) = Unit
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -309,6 +309,14 @@ class TimelineEventController @Inject constructor(private val dateFormatter: Vec
|
|||
// no-op, already handled
|
||||
}
|
||||
|
||||
override fun onStateUpdated(direction: Timeline.Direction, state: Timeline.PaginationState) {
|
||||
if(!state.hasMoreToLoad) {
|
||||
backgroundHandler.post {
|
||||
requestModelBuild()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun submitSnapshot(newSnapshot: List<TimelineEvent>) {
|
||||
backgroundHandler.post {
|
||||
inSubmitList = true
|
||||
|
|
Loading…
Reference in a new issue