[Android] Update fastscroller state on display update

Geoffrey Métais git at videolan.org
Fri Nov 4 14:42:18 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Nov  4 12:04:29 2016 +0100| [cc9e557a6ce684abe369d6581285df7653751c8f] | committer: Geoffrey Métais

Update fastscroller state on display update

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

 vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java | 1 +
 vlc-android/src/org/videolan/vlc/gui/view/FastScroller.java          | 2 ++
 2 files changed, 3 insertions(+)

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 1934814..f6dd221 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -518,6 +518,7 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements Device
                     mSwipeRefreshLayout.setRefreshing(false);
                     mDisplaying = false;
                     updateEmptyView(mViewPager.getCurrentItem());
+                    mFastScroller.setRecyclerView((RecyclerView) mLists.get(mViewPager.getCurrentItem()));
                 }
             });
     }
diff --git a/vlc-android/src/org/videolan/vlc/gui/view/FastScroller.java b/vlc-android/src/org/videolan/vlc/gui/view/FastScroller.java
index 4c51b04..670aa38 100644
--- a/vlc-android/src/org/videolan/vlc/gui/view/FastScroller.java
+++ b/vlc-android/src/org/videolan/vlc/gui/view/FastScroller.java
@@ -155,6 +155,8 @@ public class FastScroller extends LinearLayout {
     }
 
     public void setRecyclerView(RecyclerView recyclerView) {
+        if (mRecyclerView != null)
+            mRecyclerView.removeOnScrollListener(scrollListener);
         setVisibility(INVISIBLE);
         mItemCount = recyclerView.getAdapter().getItemCount();
         this.mRecyclerView = recyclerView;



More information about the Android mailing list