[Android] Improve video comparison in lists updates
Geoffrey Métais
git at videolan.org
Wed Apr 19 14:46:05 CEST 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Apr 19 14:38:21 2017 +0200| [6633c6ec14b1a45e86ff5221bb2c1f3d9b50946a] | committer: Geoffrey Métais
Improve video comparison in lists updates
> https://code.videolan.org/videolan/vlc-android/commit/6633c6ec14b1a45e86ff5221bb2c1f3d9b50946a
---
vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
index d05409f..cf2446d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
@@ -536,7 +536,9 @@ public class VideoListAdapter extends RecyclerView.Adapter<VideoListAdapter.View
@Override
public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
- return oldList != null && newList != null && oldList.get(oldItemPosition).equals(newList.get(newItemPosition));
+ MediaWrapper oldItem = oldList.get(oldItemPosition);
+ MediaWrapper newItem = newList.get(newItemPosition);
+ return oldList != null && newList != null && oldItem.getType() == newItem.getType() && oldItem.equals(newItem);
}
@Override
More information about the Android
mailing list