Search in sources :

Example 1 with ChannelInfoItem

use of org.schabi.newpipe.extractor.channel.ChannelInfoItem in project NewPipe by TeamNewPipe.

the class SubscriptionEntity method toChannelInfoItem.

@Ignore
public ChannelInfoItem toChannelInfoItem() {
    ChannelInfoItem item = new ChannelInfoItem(getServiceId(), getUrl(), getName());
    item.setThumbnailUrl(getAvatarUrl());
    item.setSubscriberCount(getSubscriberCount());
    item.setDescription(getDescription());
    return item;
}
Also used : ChannelInfoItem(org.schabi.newpipe.extractor.channel.ChannelInfoItem) Ignore(android.arch.persistence.room.Ignore)

Example 2 with ChannelInfoItem

use of org.schabi.newpipe.extractor.channel.ChannelInfoItem in project NewPipe by TeamNewPipe.

the class BaseListFragment method initListeners.

@Override
protected void initListeners() {
    super.initListeners();
    infoListAdapter.setOnStreamSelectedListener(new OnClickGesture<StreamInfoItem>() {

        @Override
        public void selected(StreamInfoItem selectedItem) {
            onItemSelected(selectedItem);
            NavigationHelper.openVideoDetailFragment(useAsFrontPage ? getParentFragment().getFragmentManager() : getFragmentManager(), selectedItem.getServiceId(), selectedItem.getUrl(), selectedItem.getName());
        }

        @Override
        public void held(StreamInfoItem selectedItem) {
            showStreamDialog(selectedItem);
        }
    });
    infoListAdapter.setOnChannelSelectedListener(new OnClickGesture<ChannelInfoItem>() {

        @Override
        public void selected(ChannelInfoItem selectedItem) {
            onItemSelected(selectedItem);
            NavigationHelper.openChannelFragment(useAsFrontPage ? getParentFragment().getFragmentManager() : getFragmentManager(), selectedItem.getServiceId(), selectedItem.getUrl(), selectedItem.getName());
        }
    });
    infoListAdapter.setOnPlaylistSelectedListener(new OnClickGesture<PlaylistInfoItem>() {

        @Override
        public void selected(PlaylistInfoItem selectedItem) {
            onItemSelected(selectedItem);
            NavigationHelper.openPlaylistFragment(useAsFrontPage ? getParentFragment().getFragmentManager() : getFragmentManager(), selectedItem.getServiceId(), selectedItem.getUrl(), selectedItem.getName());
        }
    });
    itemsList.clearOnScrollListeners();
    itemsList.addOnScrollListener(new OnScrollBelowItemsListener() {

        @Override
        public void onScrolledDown(RecyclerView recyclerView) {
            onScrollToBottom();
        }
    });
}
Also used : OnScrollBelowItemsListener(org.schabi.newpipe.fragments.OnScrollBelowItemsListener) StreamInfoItem(org.schabi.newpipe.extractor.stream.StreamInfoItem) RecyclerView(android.support.v7.widget.RecyclerView) ChannelInfoItem(org.schabi.newpipe.extractor.channel.ChannelInfoItem) PlaylistInfoItem(org.schabi.newpipe.extractor.playlist.PlaylistInfoItem)

Example 3 with ChannelInfoItem

use of org.schabi.newpipe.extractor.channel.ChannelInfoItem in project NewPipe by TeamNewPipe.

the class ChannelMiniInfoItemHolder method updateFromItem.

@Override
public void updateFromItem(final InfoItem infoItem) {
    if (!(infoItem instanceof ChannelInfoItem))
        return;
    final ChannelInfoItem item = (ChannelInfoItem) infoItem;
    itemTitleView.setText(item.getName());
    itemAdditionalDetailView.setText(getDetailLine(item));
    itemBuilder.getImageLoader().displayImage(item.getThumbnailUrl(), itemThumbnailView, ImageDisplayConstants.DISPLAY_THUMBNAIL_OPTIONS);
    itemView.setOnClickListener(view -> {
        if (itemBuilder.getOnChannelSelectedListener() != null) {
            itemBuilder.getOnChannelSelectedListener().selected(item);
        }
    });
}
Also used : ChannelInfoItem(org.schabi.newpipe.extractor.channel.ChannelInfoItem)

Example 4 with ChannelInfoItem

use of org.schabi.newpipe.extractor.channel.ChannelInfoItem in project NewPipe by TeamNewPipe.

the class ChannelInfoItemHolder method updateFromItem.

@Override
public void updateFromItem(final InfoItem infoItem) {
    super.updateFromItem(infoItem);
    if (!(infoItem instanceof ChannelInfoItem))
        return;
    final ChannelInfoItem item = (ChannelInfoItem) infoItem;
    itemChannelDescriptionView.setText(item.getDescription());
}
Also used : ChannelInfoItem(org.schabi.newpipe.extractor.channel.ChannelInfoItem)

Aggregations

ChannelInfoItem (org.schabi.newpipe.extractor.channel.ChannelInfoItem)4 Ignore (android.arch.persistence.room.Ignore)1 RecyclerView (android.support.v7.widget.RecyclerView)1 PlaylistInfoItem (org.schabi.newpipe.extractor.playlist.PlaylistInfoItem)1 StreamInfoItem (org.schabi.newpipe.extractor.stream.StreamInfoItem)1 OnScrollBelowItemsListener (org.schabi.newpipe.fragments.OnScrollBelowItemsListener)1