Fix info bar and list reloading

This commit is contained in:
Martin Fietz 2015-11-06 20:29:03 +01:00
parent c13dd34f09
commit 86074f0b8b
1 changed files with 8 additions and 2 deletions

View File

@ -169,6 +169,7 @@ public class QueueFragment extends Fragment {
recyclerAdapter.notifyItemMoved(from, to);
break;
}
onFragmentLoaded();
}
public void onEventMainThread(FeedItemEvent event) {
@ -430,7 +431,6 @@ public class QueueFragment extends Fragment {
txtvEmpty.setVisibility(View.GONE);
recyclerView.setVisibility(View.VISIBLE);
}
recyclerAdapter.notifyDataSetChanged();
restoreScrollPosition();
@ -438,7 +438,10 @@ public class QueueFragment extends Fragment {
// needs data that may have just been loaded.
getActivity().supportInvalidateOptionsMenu();
// refresh information bar
refreshInfoBar();
}
private void refreshInfoBar() {
String info = queue.size() + getString(R.string.episodes_suffix);
if(queue.size() > 0) {
long duration = 0;
@ -549,6 +552,9 @@ public class QueueFragment extends Fragment {
progLoading.setVisibility(View.GONE);
queue = items;
onFragmentLoaded();
if(recyclerAdapter != null) {
recyclerAdapter.notifyDataSetChanged();
}
}
}, error -> {
Log.e(TAG, Log.getStackTraceString(error));