[Android] Use correct list for current fragment update

Geoffrey Métais git at videolan.org
Mon Feb 12 15:02:01 CET 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 12 12:12:44 2018 +0100| [e57e5247882121b8dc78437ffbdb9224494889a0] | committer: Geoffrey Métais

Use correct list for current fragment update

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

 vlc-android/src/org/videolan/vlc/SortableAdapter.java | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/SortableAdapter.java b/vlc-android/src/org/videolan/vlc/SortableAdapter.java
index 8292856d4..238c20c95 100644
--- a/vlc-android/src/org/videolan/vlc/SortableAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/SortableAdapter.java
@@ -6,7 +6,6 @@ import android.support.v7.widget.RecyclerView;
 import org.jetbrains.annotations.NotNull;
 import org.videolan.medialibrary.media.MediaLibraryItem;
 import org.videolan.vlc.gui.DiffUtilAdapter;
-import org.videolan.vlc.util.MediaItemDiffCallback;
 import org.videolan.vlc.util.MediaLibraryItemComparator;
 import org.videolan.vlc.util.Util;
 
@@ -38,8 +37,7 @@ public abstract class SortableAdapter<T extends MediaLibraryItem, VH extends Rec
     }
 
     public void updateIfSortChanged() {
-        if (!hasPendingUpdates() && hasSortChanged())
-            update(new ArrayList<>(getDataset()));
+        if (!hasPendingUpdates() && hasSortChanged()) update(new ArrayList<>(peekLast()));
     }
 
     private boolean hasSortChanged() {



More information about the Android mailing list