Commit 36cdd2f8 authored by Geoffrey Métais's avatar Geoffrey Métais

Conditionnally enable PTR on audio list update

parent c7cb4e81
......@@ -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());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment