library / com.camerash.filterdrawer / FilterableRecyclerAdapter

FilterableRecyclerAdapter

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

Parameters

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

DiffItemCallback

RecyclerAdapterFilter

FilterRecyclerViewDiffCallback

Constructors

<init>

FilterableRecyclerAdapter()

Base implementation of RecyclerAdapter that is filterable by FilterDrawer

Properties

dataList

abstract var dataList: List<Data>

The list of data with type List

Functions

bindFilterDrawer

fun bindFilterDrawer(filterDrawer: FilterDrawer<Parent, Child>): Unit

Binds a FilterDrawer with this RecyclerAdapter

getItemCount

fun getItemCount(): Int

Return size of filtered list

onAttachedToRecyclerView

open fun onAttachedToRecyclerView(recyclerView: RecyclerView): Unit

Set RecyclerView to have fixed size for filtering

onChildDeselect

fun onChildDeselect(parent: Parent, child: Set<Child>): Unit

Method for OnChildSelectListener interface

onChildSelect

fun onChildSelect(parent: Parent, child: Set<Child>): Unit

Method for OnChildSelectListener interface

onDetachedFromRecyclerView

open fun onDetachedFromRecyclerView(recyclerView: RecyclerView): Unit

Unbinds FilterDrawer when detached from RecyclerView

onReset

fun onReset(): Unit

Method for OnChildSelectListener interface

unbindFilterDrawer

fun unbindFilterDrawer(): Unit

Unbinds the bound FilterDrawer

Inherited Functions

filter

abstract fun filter(data: Data, parent: Parent, child: Child): Boolean

Called when filtering of data items happens