[Android] Delay Artist/Genres tab skipping

Geoffrey Métais git at videolan.org
Thu Sep 6 18:32:57 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Sep  6 18:32:13 2018 +0200| [6b989830fc8a44f4f9fe8d52a2adb8923ff1274c] | committer: Geoffrey Métais

Delay Artist/Genres tab skipping

onCurrentListChanged callback is fired too soon

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

 .../src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
index 0b7431447..cedd7497c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
@@ -189,7 +189,14 @@ public class AudioAlbumsSongsFragment extends BaseAudioBrowser implements SwipeR
         super.onUpdateFinished(adapter);
         mFastScroller.setRecyclerView(getCurrentRV(), getViewModel().getTotalCount());
         mSwipeRefreshLayout.setRefreshing(false);
-        if (mAlbumsAdapter.isEmpty() && !getViewModel().isFiltering()) mViewPager.setCurrentItem(1);
+        final List<Album> albums = albumModel.getPagedList().getValue();
+        if (Util.isListEmpty(albums) && !getViewModel().isFiltering()) mHandler.post(new Runnable() {
+            @Override
+            public void run() {
+                final List<Album> list = albumModel.getPagedList().getValue();
+                if (Util.isListEmpty(list)) mViewPager.setCurrentItem(1);
+            }
+        });
     }
 
     /*



More information about the Android mailing list