[Android] Send thumbnailer jobs after triggering display

Geoffrey Métais git at videolan.org
Wed May 25 17:24:24 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed May 25 17:23:52 2016 +0200| [e0bb0d744e4806d20f465e38974a2b75edda23a6] | committer: Geoffrey Métais

Send thumbnailer jobs after triggering display

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

 .../org/videolan/vlc/gui/video/VideoGridFragment.java | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 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 d42d5e5..c53cfe5 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -405,29 +405,26 @@ public class VideoGridFragment extends MediaBrowserFragment implements ISortable
                 @Override
                 public void run() {
                     final ArrayList<MediaWrapper> displayList = new ArrayList<>();
-
                     if (mGroup != null || itemList.size() <= 10) {
                         for (MediaWrapper item : itemList) {
-                            if (mGroup == null || item.getTitle().startsWith(mGroup)) {
+                            if (mGroup == null || item.getTitle().startsWith(mGroup))
                                 displayList.add(item);
-                                if (mThumbnailer != null)
-                                    mThumbnailer.addJob(item);
-                            }
                         }
-                    }
-                    else {
+                    } else {
                         List<MediaGroup> groups = MediaGroup.group(itemList);
-                        for (MediaGroup item : groups) {
+                        for (MediaGroup item : groups)
                             displayList.add(item.getMedia());
-                            if (mThumbnailer != null)
-                                mThumbnailer.addJob(item.getMedia());
-                        }
                     }
 
+                    final ArrayList<MediaWrapper> jobsList = new ArrayList<>(displayList);
                     mVideoAdapter.addAll(displayList);
                     mVideoAdapter.sort();
                     if (mReadyToDisplay)
                         display();
+                    if (mThumbnailer != null) {
+                        for (MediaWrapper item : jobsList)
+                            mThumbnailer.addJob(item);
+                    }
                 }
             });
         }



More information about the Android mailing list