1
votes

The RecyclerView is already created, just the list of songs (name and artist) (LinearLayout). I have to add the sections, so that the songs can be assigned to a section.

I already have the SongsAdapter, which uses my song_layout in onCreateViewHolder function.

What i tried: I created the separate layout for Sections (section_layout) and implemented the SectionsAdapter.

My question is, is that the right way to go, having separate adapters? If so, then how do I pass the SongsAdapter into the SectionsAdapter, so that the Song is presented as a Section's child?

You want to implement multiple view type in this case. Which is already been discussed number of times. Please do some research. This can be helpful: stackoverflow.com/questions/26245139/… - skafle