[Android] Conditionnally enable PTR on audio list update
Geoffrey Métais
git at videolan.org
Thu Feb 16 15:31:40 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Feb 16 14:54:02 2017 +0100| [36cdd2f812cff97fd275766c6999e95aa3668ceb] | committer: Geoffrey Métais
Conditionnally enable PTR on audio list update
> https://code.videolan.org/videolan/vlc-android/commit/36cdd2f812cff97fd275766c6999e95aa3668ceb
---
.../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java | 8 +-------
1 file changed, 1 insertion(+), 7 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 6a3a32a..1eff2a0 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -213,13 +213,6 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements DevicesDis
fillView();
else
setupMediaLibraryReceiver();
- final RecyclerView current = getCurrentRV();
- current.post(new Runnable() {
- @Override
- public void run() {
- mSwipeRefreshLayout.setEnabled(((LinearLayoutManager)current.getLayoutManager()).findFirstVisibleItemPosition() == 0);
- }
- });
}
protected void fillView() {
@@ -563,6 +556,7 @@ public class AudioBrowserFragment extends BaseAudioBrowser implements DevicesDis
@Override
public void onUpdateFinished(RecyclerView.Adapter adapter) {
if (adapter == getCurrentAdapter()) {
+ mSwipeRefreshLayout.setEnabled(((LinearLayoutManager)getCurrentRV().getLayoutManager()).findFirstVisibleItemPosition() <= 0);
updateEmptyView(mViewPager.getCurrentItem());
mFastScroller.setRecyclerView(getCurrentRV());
}
More information about the Android
mailing list