davideas / FlexibleAdapter

Fast and versatile Adapter for RecyclerView which regroups several features into one library to considerably improve the user experience :-)
Apache License 2.0
3.56k stars 552 forks source link

How to find number of Items in RecyclerView when Filtered #754

Closed jabi1995 closed 4 years ago

jabi1995 commented 4 years ago

When Using getItemCount method to find filtered items in recyclerView returns previous filtered items number as value! what is the problem !!

jabi1995 commented 4 years ago

Actually the main reason why this condition has been faced was that I tried to get the item counts immediately after filtering the items so THERE WAS NO TIME TO CALCULATE THE NUMBER OF ITEMS, Just after executing the method (setFilter) I tried to ask for item counts one seconds (may be less, I didn't try) later so the result was correct :)