use of de.danoeh.antennapod.adapter.QueueRecyclerAdapter in project AntennaPod by AntennaPod.
the class QueueFragment method onFragmentLoaded.
private void onFragmentLoaded(final boolean restoreScrollPosition) {
if (recyclerAdapter == null) {
MainActivity activity = (MainActivity) getActivity();
recyclerAdapter = new QueueRecyclerAdapter(activity, itemAccess, new DefaultActionButtonCallback(activity), itemTouchHelper);
recyclerAdapter.setHasStableIds(true);
recyclerView.setAdapter(recyclerAdapter);
}
if (queue == null || queue.size() == 0) {
recyclerView.setVisibility(View.GONE);
txtvEmpty.setVisibility(View.VISIBLE);
} else {
txtvEmpty.setVisibility(View.GONE);
recyclerView.setVisibility(View.VISIBLE);
}
if (restoreScrollPosition) {
restoreScrollPosition();
}
// we need to refresh the options menu because it sometimes
// needs data that may have just been loaded.
getActivity().supportInvalidateOptionsMenu();
refreshInfoBar();
}
Aggregations