[Android] Fix infinite loading when medialibrary has no audio

Geoffrey Métais git at videolan.org
Wed Sep 27 12:13:18 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Sep 27 10:22:16 2017 +0200| [185ac1f256bd2cc1fc7fc57651d045eb23352efc] | committer: Geoffrey Métais

Fix infinite loading when medialibrary has no audio

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

 .../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java     | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

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 d04ff4e2e..139929b37 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -96,8 +96,6 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
     private final static int MODE_PLAYLIST = 4;
     private final static int MODE_TOTAL = 5; // Number of audio browser modes
 
-    public final static int MSG_LOADING = 0;
-
     public final static String TAG_ITEM = "ML_ITEM";
 
     @Override
@@ -554,11 +552,6 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
         final AudioBrowserFragment fragment = getOwner();
         if (fragment == null) return;
         switch (msg.what) {
-            case MSG_LOADING:
-                if (fragment.mArtistsAdapter.isEmpty() && fragment.mAlbumsAdapter.isEmpty() &&
-                        fragment.mSongsAdapter.isEmpty() && fragment.mGenresAdapter.isEmpty())
-                    fragment.mSwipeRefreshLayout.setRefreshing(true);
-                break;
             case REFRESH:
                 refresh(fragment, (String) msg.obj);
                 break;
@@ -591,7 +584,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
     @MainThread
     private void updateLists() {
         mTabLayout.setVisibility(View.VISIBLE);
-        mHandler.sendEmptyMessageDelayed(MSG_LOADING, 300);
+        mHandler.sendEmptyMessageDelayed(SET_REFRESHING, 300);
         mHandler.removeMessages(UPDATE_LIST);
         updateArtists();
         updateAlbums();



More information about the Android mailing list