[Android] Use a SparseArray for headers indexing

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


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb 14 11:33:39 2019 +0100| [0b0ad2db0bdde4a033a50a733361913ae1b94feb] | committer: Geoffrey Métais

Use a SparseArray for headers indexing

> https://code.videolan.org/videolan/vlc-android/commit/0b0ad2db0bdde4a033a50a733361913ae1b94feb
---

 vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 830a2a744..ce9dcf172 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt
@@ -1,7 +1,7 @@
 package org.videolan.vlc.viewmodels.paged
 
 import android.content.Context
-import androidx.collection.SimpleArrayMap
+import androidx.collection.SparseArrayCompat
 import androidx.lifecycle.MutableLiveData
 import androidx.paging.DataSource
 import androidx.paging.LivePagedListBuilder
@@ -20,7 +20,7 @@ abstract class MLPagedModel<T : MediaLibraryItem>(context: Context) : SortableMo
     protected val medialibrary = Medialibrary.getInstance()
     val loading = MutableLiveData<Boolean>().apply { value = false }
 
-    protected val headers = SimpleArrayMap<Int, String>()
+    protected val headers = SparseArrayCompat<String>()
 
     private val pagingConfig = PagedList.Config.Builder()
             .setPageSize(MEDIALIBRARY_PAGE_SIZE)



More information about the Android mailing list