0

I am working on a project where I need recyling a list of litho components using a custom recyclerview adapter. The only issue is that I can't use RecyclerComponent which comes as part of the litho library.

Is there a way to do this? Specifically, what needs to go inside onCreateViewHolder() and onBindViewHolder()?

omerjerk
  • 4,090
  • 5
  • 40
  • 57

1 Answers1

0

You will want to use RecyclerCollectionComponent with the Sections API if possible: https://fblitho.com/docs/recycler-collection-component.

If you can't do that for some reason, you also have the option to use RecyclerBinder directly by adding components via insertItemAt/insertRangeAt. RecyclerBinder#getInternalAdapter will give you the RecyclerView.Adapter that you can give to your RecyclerView.

Foxichu
  • 952
  • 10
  • 22