1

Is there any solution how to implement Horizontal recyclerview with the combination of vertical recyclerview that is inside every column of this horizontal list? Something very similar like in Android Trello app (red arrows - slide for the whole list, brown arrow - slide in every list separately). I'm trying to focus on the performance of the app, so no predrawing of the recyclerview for every column, there should probably work recycling of not-seeing rows in every column recyclerview as much as for the whole horizontal recyclerview.

enter image description here

jantursky
  • 1,122
  • 1
  • 10
  • 21

2 Answers2

1

I tried a couple of solutions/combinations, but the best solution for me was using this logic:

  • initialization - AsyncLayoutInflater asyncInflater, LayoutInflater inflater
  • calculate width and height of view
  • calculate width and height of single block, should be the same sizes for every block
  • using blocking variable for case of redrawing during drawing
  • async inflate of the view
  • prepare data in the inflater listener
  • async again if there is left some space for the block
  • store the view in the array, store the data
  • loop and inflate again, until all the spaces will be occupied
  • draw the data

Maybe the logic looks kinda hard, but it was the beeter and I'got really good handling for later cases. I know, that I could use also multiple RecyclerView splitted into blocks, but it was much more difficult to listen for changes and handle them.

jantursky
  • 1,122
  • 1
  • 10
  • 21
-2

Have a look at this site Nested Recyclerview

Vector
  • 3,066
  • 5
  • 27
  • 54