abstract class FilterableRecyclerAdapter<Data : DiffItemCallback<Data>, Parent : ParentItem, Child : ChildItem> : Adapter<ViewHolder>, OnChildSelectListener<Parent, Child>, RecyclerAdapterFilter<Data, Parent, Child>
Base implementation of RecyclerAdapter that is filterable by FilterDrawer
Data
- Your custom data type that implements DiffItemCallback
Parent
- Your custom parent type that extends ParentItem
Child
- Your custom child type that extends ChildItem
Author
Camerash
See Also
FilterRecyclerViewDiffCallback
FilterableRecyclerAdapter()
Base implementation of RecyclerAdapter that is filterable by FilterDrawer |
abstract var dataList: List<Data>
The list of data with type List |
fun bindFilterDrawer(filterDrawer: FilterDrawer<Parent, Child>): Unit
Binds a FilterDrawer with this RecyclerAdapter |
|
fun getItemCount(): Int
Return size of filtered list |
|
open fun onAttachedToRecyclerView(recyclerView: RecyclerView): Unit
Set RecyclerView to have fixed size for filtering |
|
fun onChildDeselect(parent: Parent, child: Set<Child>): Unit
Method for OnChildSelectListener interface |
|
fun onChildSelect(parent: Parent, child: Set<Child>): Unit
Method for OnChildSelectListener interface |
|
open fun onDetachedFromRecyclerView(recyclerView: RecyclerView): Unit
Unbinds FilterDrawer when detached from RecyclerView |
|
fun onReset(): Unit
Method for OnChildSelectListener interface |
|
fun unbindFilterDrawer(): Unit
Unbinds the bound FilterDrawer |
abstract fun filter(data: Data, parent: Parent, child: Child): Boolean
Called when filtering of data items happens |