Search in sources :

Example 1 with QueueRecyclerAdapter

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();
}
Also used : DefaultActionButtonCallback(de.danoeh.antennapod.adapter.DefaultActionButtonCallback) MainActivity(de.danoeh.antennapod.activity.MainActivity) QueueRecyclerAdapter(de.danoeh.antennapod.adapter.QueueRecyclerAdapter)

Aggregations

MainActivity (de.danoeh.antennapod.activity.MainActivity)1 DefaultActionButtonCallback (de.danoeh.antennapod.adapter.DefaultActionButtonCallback)1 QueueRecyclerAdapter (de.danoeh.antennapod.adapter.QueueRecyclerAdapter)1