[Android] Fix incorrect headers position in index

Geoffrey Métais git at videolan.org
Thu Feb 14 11:59:29 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb 14 11:59:03 2019 +0100| [3749bdbd48e5f1cfe34ca508b903bd8d0bd88044] | committer: Geoffrey Métais

Fix incorrect headers position in index

> https://code.videolan.org/videolan/vlc-android/commit/3749bdbd48e5f1cfe34ca508b903bd8d0bd88044
---

 vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedAlbumsModel.kt   | 2 +-
 vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedArtistsModel.kt  | 2 +-
 vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedFoldersModel.kt  | 2 +-
 vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedGenresModel.kt   | 2 +-
 .../src/org/videolan/vlc/viewmodels/paged/PagedPlaylistsModel.kt        | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedAlbumsModel.kt b/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedAlbumsModel.kt
index 7bc727881..992da7901 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedAlbumsModel.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedAlbumsModel.kt
@@ -45,7 +45,7 @@ class PagedAlbumsModel(context: Context, val parent: MediaLibraryItem? = null) :
             is Genre -> parent.searchAlbums(filterQuery, sort, desc, loadSize, startposition)
             else -> medialibrary.searchAlbum(filterQuery, sort, desc, loadSize, startposition)
         }
-        list?.let { completeHeaders(it, 0) }
+        list?.let { completeHeaders(it, startposition) }
         return list
     }
 
diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedArtistsModel.kt b/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedArtistsModel.kt
index 719e48e33..e61666e73 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedArtistsModel.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedArtistsModel.kt
@@ -26,7 +26,7 @@ class PagedArtistsModel(context: Context, private var showAll: Boolean = false):
     override fun getPage(loadSize: Int, startposition: Int): Array<Artist> {
         val list = if (filterQuery == null) medialibrary.getPagedArtists(showAll, sort, desc, loadSize, startposition)
         else medialibrary.searchArtist(filterQuery, sort, desc, loadSize, startposition)
-        list?.let { completeHeaders(it, 0) }
+        list?.let { completeHeaders(it, startposition) }
         return list
     }
 
diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedFoldersModel.kt b/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedFoldersModel.kt
index 587355b25..9e7d74132 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedFoldersModel.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedFoldersModel.kt
@@ -20,7 +20,7 @@ class PagedFoldersModel(context: Context, val type: Int) : MLPagedModel<Folder>(
 
     override fun getTotalCount() = medialibrary.getFoldersCount(type)
 
-    override fun getPage(loadSize: Int, startposition: Int) : Array<Folder> = medialibrary.getFolders(type, sort, desc, loadSize, startposition).also { completeHeaders(it, 0) }
+    override fun getPage(loadSize: Int, startposition: Int) : Array<Folder> = medialibrary.getFolders(type, sort, desc, loadSize, startposition).also { completeHeaders(it, startposition) }
 
     suspend fun play(position: Int) {
         val list = withContext(Dispatchers.IO) { pagedList.value?.get(position)?.getAll()}
diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedGenresModel.kt b/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedGenresModel.kt
index 62c2d516d..765aab81c 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedGenresModel.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedGenresModel.kt
@@ -31,7 +31,7 @@ class PagedGenresModel(context: Context): MLPagedModel<Genre>(context), Medialib
     override fun getPage(loadSize: Int, startposition: Int) : Array<Genre> {
         val list = if (filterQuery == null) medialibrary.getPagedGenres(sort, desc, loadSize, startposition)
         else medialibrary.searchGenre(filterQuery, sort, desc, loadSize, startposition)
-        return list.also { completeHeaders(it, 0) }
+        return list.also { completeHeaders(it, startposition) }
     }
 
     override fun getTotalCount() = if (filterQuery == null) medialibrary.genresCount else medialibrary.getGenresCount(filterQuery)
diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedPlaylistsModel.kt b/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedPlaylistsModel.kt
index 7ce3ff249..9a5ea89fa 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedPlaylistsModel.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/paged/PagedPlaylistsModel.kt
@@ -29,7 +29,7 @@ class PagedPlaylistsModel(context: Context): MLPagedModel<Playlist>(context), Me
     override fun getPage(loadSize: Int, startposition: Int)  : Array<Playlist> {
         val list = if (filterQuery == null) medialibrary.getPagedPlaylists(sort, desc, loadSize, startposition)
         else medialibrary.searchPlaylist(filterQuery, sort, desc, loadSize, startposition)
-        return list.also { completeHeaders(it, 0) }
+        return list.also { completeHeaders(it, startposition) }
     }
 
     override fun getTotalCount() = if (filterQuery == null) medialibrary.playlistsCount else medialibrary.getPlaylistsCount(filterQuery)



More information about the Android mailing list