VideoPlayerManager icon indicating copy to clipboard operation
VideoPlayerManager copied to clipboard

question about VideoRecyclerViewAdapter.java in video_list_demo

Open hanggrian opened this issue 8 years ago • 0 comments

If you look at VideoRecyclerViewAdapter.java, specifically at:

@Override
    public VideoViewHolder onCreateViewHolder(ViewGroup viewGroup, int position) {
        BaseVideoItem videoItem = mList.get(position);
        View resultView = videoItem.createView(viewGroup, mContext.getResources().getDisplayMetrics().widthPixels);
        return new VideoViewHolder(resultView);
    }

Isn't onCreateViewHolder in RecyclerView.Adapter has view type as second parameter instead of position? It could have made sense if it override getItemViewType to return position. But in this case, it didn't, therefore the second parameter of onCreateViewHolder should be 0 (default type). How could the sample app even works?

While we're at it, why does the adapter class holds VideoPlayerManager? It is clearly not used in both items extending BaseVideoItem#update().

hanggrian avatar Dec 22 '16 16:12 hanggrian