[Android] AudioBrowser: fix glitches when refreshing

Thomas Guillem git at videolan.org
Tue Oct 6 18:32:35 CEST 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Oct  6 18:32:11 2015 +0200| [4cb403ee72e900cd7fd4f8c40b7371701ea69418] | committer: Thomas Guillem

AudioBrowser: fix glitches when refreshing

Don't clear adapter from an other thread...

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=4cb403ee72e900cd7fd4f8c40b7371701ea69418
---

 vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java  |    1 -
 .../src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java       |    1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index b322bca..6a6a286 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -716,7 +716,6 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements SwipeR
     }
 
     private void updateLists() {
-        clear();
         mAudioList = MediaLibrary.getInstance().getAudioItems();
         if (mAudioList.isEmpty()){
             updateEmptyView(mViewPager.getCurrentItem());
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
index 1abeec2..521260f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
@@ -157,6 +157,7 @@ public class AudioBrowserListAdapter extends BaseAdapter implements SectionIndex
         mContext.runOnUiThread(new Runnable() {
             @Override
             public void run() {
+                clear();
                 String title, subTitle, key;
                 for (MediaWrapper media : list) {
                     switch (type){



More information about the Android mailing list