[Android] Fix groups degrouped after thumbnail generated

Geoffrey Métais git at videolan.org
Fri May 27 11:28:09 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri May 27 11:20:20 2016 +0200| [141ca4d3a85e691917ee0bdc7aca37b78e359bfa] | committer: Geoffrey Métais

Fix groups degrouped after thumbnail generated

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

 vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java | 3 ++-
 vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index 4f546d2..6cc62c3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -470,7 +470,8 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
     }
 
     public void setItemToUpdate(MediaWrapper item) {
-        mHandler.sendMessage(mHandler.obtainMessage(MediaLibrary.UPDATE_ITEM, item));
+        if (mVideoAdapter.getAll().contains(item))
+            mHandler.sendMessage(mHandler.obtainMessage(MediaLibrary.UPDATE_ITEM, item));
     }
 
     public void setGroup(String prefix) {
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 844910c..60f6647 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
@@ -242,7 +242,8 @@ public class VideoListAdapter extends RecyclerView.Adapter<VideoListAdapter.View
     public void update(MediaWrapper item) {
         int position = mVideos.indexOf(item);
         if (position != -1) {
-            mVideos.set(position, item);
+            if (!(mVideos.get(position) instanceof MediaGroup))
+                mVideos.set(position, item);
             notifyItemChanged(position);
         } else {
             MediaWrapper mw;



More information about the Android mailing list