Search in sources :

Example 6 with LocalItem

use of org.schabi.newpipe.database.LocalItem 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

LocalItem (org.schabi.newpipe.database.LocalItem)6 ArrayList (java.util.ArrayList)3 PlaylistStreamEntry (org.schabi.newpipe.database.playlist.PlaylistStreamEntry)3 RecyclerView (android.support.v7.widget.RecyclerView)2 PlaylistMetadataEntry (org.schabi.newpipe.database.playlist.PlaylistMetadataEntry)2 StreamInfoItem (org.schabi.newpipe.extractor.stream.StreamInfoItem)2 SinglePlayQueue (org.schabi.newpipe.playlist.SinglePlayQueue)2 FragmentManager (android.support.v4.app.FragmentManager)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)1 View (android.view.View)1 CompositeDisposable (io.reactivex.disposables.CompositeDisposable)1 Disposable (io.reactivex.disposables.Disposable)1 PlaylistLocalItem (org.schabi.newpipe.database.playlist.PlaylistLocalItem)1 PlaylistRemoteEntity (org.schabi.newpipe.database.playlist.model.PlaylistRemoteEntity)1 StreamStatisticsEntry (org.schabi.newpipe.database.stream.StreamStatisticsEntry)1 LocalItemListAdapter (org.schabi.newpipe.fragments.local.LocalItemListAdapter)1 LocalPlaylistManager (org.schabi.newpipe.fragments.local.LocalPlaylistManager)1