These are the steps to use the adapter.
- Replace the adapter extending ListAdapter with FilterableListAdapter.
- Implement the method onFilter that provides a List and the string the was passed to the filter method
- Update the list according the constraint
val filterAdapter = null // Your adapter instance here
filterAdapter.filter.filter(/*Pass your string here*/)
Regarding the filter callback I want to know if upon using filter, the list became empty so I can show a message to user. Does checking
adapter.currentList.isEmpty()
will do this or thecurrenList
represent the original list thus will not be empty after applying a filter?