I
I
ivanessence2018-04-19 14:37:46
Android
ivanessence, 2018-04-19 14:37:46

How to implement search in RecycleView with subheaders?

There was a need to implement a search in RecycleView so that the search result is displayed as
HEADER
item
item
HEADER
item
item
I did not find any solutions, the only thought is, each time you search, re-form the List in a cycle and display it in RecycleView. Maybe there is a better solution?
5ad87f673aa1d989684515.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2018-04-20
@zagayevskiy

Is the question in search, list or subheaders? These three things are generally perpendicular and do not affect each other in fact. You implement the search as you like, get a new list, use DiffUtil to push the changes into the adapter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question