When you’re watching a video, below the video has so many items that scroll together seamlessly. You have the video title section, the thumbs up/down button section, subscribe section, then the up next/related videos list, then the comments list. It’s pretty complex. Do they do all this with the RecyclerView w/ bunch of different item types? Or is it some custom thing that they did? Thanks.
2 Answers
To achieve similar functionality, you need to create multiple item types in a RecyclerView. You can create something similar to this.
Is there an addHeaderView equivalent for RecyclerView?
The video, title, thumbs-up/down buttons, subscribe section can all go into the single item type at position 0 (Something like a header). As the comments section is also a list you need to write logic and push different item for comments.
It's may look pretty complex, but implementing would be easier you just have to handle the condition of the item type.

- 338
- 1
- 11
I cannot comment on exactly how the YouTube app is constructed (considering we don't have access to the code, it isn't open source) but I would imagine that your guess is correct. A RecyclerView
with multiple item types seems like a reasonable assumption. Even if that is not how the YouTube app handles it, RecyclerView
should more than sufficient for creating a similar interface.

- 14,756
- 10
- 70
- 125