[Android] Reset fastscroller on tab change

Geoffrey Métais git at videolan.org
Wed Feb 13 16:16:00 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Feb 13 16:10:07 2019 +0100| [6525fe9a75e05a0fc02cec81a3ca670a0ae5a5fe] | committer: Geoffrey Métais

Reset fastscroller on tab change

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

 .../src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java    | 6 ++++++
 .../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java        | 1 +
 2 files changed, 7 insertions(+)

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 f43110877..e1d85bf21 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
@@ -237,6 +237,12 @@ public class AudioAlbumsSongsFragment extends BaseAudioBrowser implements SwipeR
         mFastScroller.setRecyclerView(mLists[tab.getPosition()], audioModels[tab.getPosition()]);
     }
 
+    @Override
+    public void onTabSelected(TabLayout.Tab tab) {
+        super.onTabSelected(tab);
+        mFastScroller.setRecyclerView(getCurrentRV(), getViewModel());
+    }
+
     @Override
     public AudioBrowserAdapter getCurrentAdapter() {
         return (AudioBrowserAdapter) getCurrentRV().getAdapter();
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 d2a8b398e..23a0c0d88 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -269,6 +269,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements SwipeRefre
     @Override
     public void onTabSelected(TabLayout.Tab tab) {
         super.onTabSelected(tab);
+        mFastScroller.setRecyclerView(getCurrentRV(), getViewModel());
         mSettings.edit().putInt(Constants.KEY_AUDIO_CURRENT_TAB, tab.getPosition()).apply();
         final Boolean loading = getViewModel().getLoading().getValue();
         if (loading == null || !loading) mHandler.sendEmptyMessage(UNSET_REFRESHING);



More information about the Android mailing list