Skip to content
Snippets Groups Projects
Commit 38c0c090 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Paged models: get count before initial page load

fix
parent f5b21a49
No related branches found
No related tags found
No related merge requests found
......@@ -82,7 +82,8 @@ abstract class MLPagedModel<T : MediaLibraryItem>(context: Context) : SortableMo
}
override fun loadInitial(params: LoadInitialParams, callback: LoadInitialCallback<T>) {
callback.onResult(getPage(params.requestedLoadSize, params.requestedStartPosition).toList(), params.requestedStartPosition, getTotalCount())
val count = getTotalCount()
callback.onResult(getPage(params.requestedLoadSize, params.requestedStartPosition).toList(), params.requestedStartPosition, count)
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment