[Android] Paged models: get count before initial page load
Geoffrey Métais
git at videolan.org
Mon Sep 10 16:35:43 CEST 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Sep 10 11:27:31 2018 +0200| [38c0c09005fe14d7f4a81b1fdda230d2d0b55a92] | committer: Geoffrey Métais
Paged models: get count before initial page load
fix
> https://code.videolan.org/videolan/vlc-android/commit/38c0c09005fe14d7f4a81b1fdda230d2d0b55a92
---
vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt b/vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt
index d9e075137..ef8109cfc 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt
@@ -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)
}
}
More information about the Android
mailing list