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*/)
Can you show how to use it and how can we specify which data from the object to filter?
Example I want to filter User data class by its first name only.
Also is there already a way to get a callback when list is being filtered, or it should be implemented inside
publishResults
Thanks