[Android] Delay Artist/Genres tab skipping

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


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

Delay Artist/Genres tab skipping

onCurrentListChanged callback is fired too soon

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

 .../org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

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..0a4c35301 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
@@ -187,9 +187,15 @@ public class AudioAlbumsSongsFragment extends BaseAudioBrowser implements SwipeR
     @Override
     public void onUpdateFinished(RecyclerView.Adapter adapter) {
         super.onUpdateFinished(adapter);
-        mFastScroller.setRecyclerView(getCurrentRV(), getViewModel().getTotalCount());
-        mSwipeRefreshLayout.setRefreshing(false);
-        if (mAlbumsAdapter.isEmpty() && !getViewModel().isFiltering()) mViewPager.setCurrentItem(1);
+        mHandler.post(new Runnable() {
+            @Override
+            public void run() {
+                mFastScroller.setRecyclerView(getCurrentRV(), getViewModel().getTotalCount());
+                mSwipeRefreshLayout.setRefreshing(false);
+                final List<Album> albums = albumModel.getPagedList().getValue();
+                if (Util.isListEmpty(albums) && !getViewModel().isFiltering()) mViewPager.setCurrentItem(1);
+            }
+        });
     }
 
     /*



More information about the Android mailing list