1

What I use fragments or views?

enter image description here

Hemant N. Karmur
  • 840
  • 1
  • 7
  • 21
  • 2
    There is no need to use fragments in here, you just need to use multiple reyclerviews – Karan Mehta Jan 15 '20 at 11:08
  • Hi. how use container recyclerview? – Novruz Ceferov Jan 15 '20 at 11:12
  • 1
    welcome to stack overflow. please understand this isn't a free coding service or a forum, we only deal with specific, code related questions here. asking for advice or not showing any effort done won't get you much help. please do some research and try something first before asking here – a_local_nobody Jan 15 '20 at 11:15
  • @NovruzCeferov I think you need to use multiple RecyclerViews with horizontal Orientation which are nested inside one parent ScrollView. – iCantC Jan 15 '20 at 11:43
  • Hey @NovruzCeferov welcome to stackoverflow, here we can help you with problems you are facing and help you solve it, we can't not tell you or give you everything. also read this [how to ask a good question](https://stackoverflow.com/help/how-to-ask) – Rahul Gaur Jan 15 '20 at 11:51
  • I think it's better if you could use a single recyclerview populating different viewtypes, so as to ensure better scrolling in contrast with scrollview with different recyclerviews. – Angeo Johny M Jan 15 '20 at 11:54

2 Answers2

2

You can use a RecyclerView with LinearLayoutManager.HORIZONTAL for a Section. If your Sections are variables then you should use nested RecyclerView where the parent RecyclerView will be LinearLayoutManager.VERTICAL & Childs will be LinearLayoutManager.HORIZONTAL

Have look on this

Afsar edrisy
  • 1,985
  • 12
  • 28
1

It depends on your needs. You can go with @Afsar's answer If you won't use the same lists in somewhere else.

If you found yourself in a situation that you need to use any list of them in other activity you can implement it as a fragment to be reusable without duplicating the logic.

You can check this answer to know more about the benefits and drawbacks of using fragments.

Mohamed Nageh
  • 1,963
  • 1
  • 19
  • 27