Search in sources :

Example 11 with SinglePlayQueue

use of org.schabi.newpipe.playlist.SinglePlayQueue in project NewPipe by TeamNewPipe.

the class StatisticsPlaylistFragment method getPlayQueue.

private PlayQueue getPlayQueue(final int index) {
    if (itemListAdapter == null) {
        return new SinglePlayQueue(Collections.emptyList(), 0);
    }
    final List<LocalItem> infoItems = itemListAdapter.getItemsList();
    List<StreamInfoItem> streamInfoItems = new ArrayList<>(infoItems.size());
    for (final LocalItem item : infoItems) {
        if (item instanceof StreamStatisticsEntry) {
            streamInfoItems.add(((StreamStatisticsEntry) item).toStreamInfoItem());
        }
    }
    return new SinglePlayQueue(streamInfoItems, index);
}
Also used : StreamInfoItem(org.schabi.newpipe.extractor.stream.StreamInfoItem) StreamStatisticsEntry(org.schabi.newpipe.database.stream.StreamStatisticsEntry) ArrayList(java.util.ArrayList) LocalItem(org.schabi.newpipe.database.LocalItem) SinglePlayQueue(org.schabi.newpipe.playlist.SinglePlayQueue)

Aggregations

SinglePlayQueue (org.schabi.newpipe.playlist.SinglePlayQueue)11 StreamInfoItem (org.schabi.newpipe.extractor.stream.StreamInfoItem)7 Context (android.content.Context)6 DialogInterface (android.content.DialogInterface)6 ArrayList (java.util.ArrayList)6 InfoItemDialog (org.schabi.newpipe.info_list.InfoItemDialog)6 Activity (android.app.Activity)5 PlayQueue (org.schabi.newpipe.playlist.PlayQueue)5 Bundle (android.os.Bundle)4 NonNull (android.support.annotation.NonNull)4 Nullable (android.support.annotation.Nullable)4 View (android.view.View)4 List (java.util.List)4 R (org.schabi.newpipe.R)4 LocalItem (org.schabi.newpipe.database.LocalItem)4 NavigationHelper (org.schabi.newpipe.util.NavigationHelper)4 Log (android.util.Log)3 LayoutInflater (android.view.LayoutInflater)3 ViewGroup (android.view.ViewGroup)3 AndroidSchedulers (io.reactivex.android.schedulers.AndroidSchedulers)3