2

I am creating UI similar to this one:

enter image description here

For this I did he following:
1. Took a parent recycler view
2. Defined two view types one for grid and one for vertical list and created two view holders.
3. Each view holder has a recycler view to which list and grid will be attached
4. Defined parent data model which is inherited by the models of list and grid.

The linear list contains around 2000 data. So when I am populating the child recycler view's adapter, it loads all data 2000 data at once(which should not happen with recycler view), thus there is visible delay. The data is fetched from server. I am unable to figure out what is happening with the child recycler view.

Nitish
  • 2,947
  • 11
  • 41
  • 74

1 Answers1

-1

Why not use one Recycler view to contain all of the things

yu wang
  • 263
  • 1
  • 6
  • I was thinking to do that. Unable to figure out, how to manage list and grid with single recycler view. – Nitish Jan 05 '18 at 04:32
  • Use one RecyclerView, split your UI to different type, e.g : each grid row is one type, each other city is one type, so when you get data from server, you can split your data to the correspoding row type, this is my suggestion – yu wang Jan 05 '18 at 04:39
  • That is what I explained in my question – Nitish Jan 05 '18 at 04:42
  • sorry, Perhaps I understand it wrong,so your code only use one RecyclerView? – yu wang Jan 05 '18 at 04:48