3

I previously had a custom recycler adapter class that implemented Filterable to enable me to filter an item list by the user entered text string.

I have recently migrated to using the Groupie library for my lists for ease of use. How can I implement this filtering feature using Groupie considering that you only deal with a single item at a time, rather than a list?

If examples or further details are required, let me know.

Thanks.

NicCoe
  • 279
  • 2
  • 15

1 Answers1

0

What I suggest you do is keep a reference to list of filterable Items you pass to your adapter. Then, whenever you want to apply a filter just call myListOfItems.filter { myFilterFunc(it) } (Kotlin example) and pass the filtered list of items to your adapter.

Valentin
  • 1,671
  • 2
  • 16
  • 28