RecyclerView change data set

前端 未结 5 2059
一个人的身影
一个人的身影 2020-12-07 11:33

I want to implement search functionality for my RecyclerView. On text changed i want to change the data that are displayed with this widget. Maybe this question has been ask

5条回答
  •  春和景丽
    2020-12-07 11:46

    As ygit answered, swapAdapter is interesting when you have to change the whole content.

    But, in my FlexibleAdapter, you can update the items with updateDataSet. You can even configure the adapter to call notifyDataSetChanged or having synchronization animations (enabled by default). That, because notifyDataSetChanged kills all the animations, but it's good to have for big lists.

    Please have a look at the description, demoApp and Wiki pages: https://github.com/davideas/FlexibleAdapter

提交回复
热议问题