class ParentAdapter<Parent : ParentItem, Child : ChildItem> : Adapter<ViewHolder>
Adapter for ParentItem used in the FilterDrawer
Parent
- Your custom parent type that extends ParentItem
Child
- Your custom child type that extends ChildItem
parentItemList
- list of ParentItem
childSelectListenerList
- list of OnChildSelectListener to be called when changes happens
Author
Camerash
See Also
ParentAdapter(parentItemList: List<Parent>, childSelectListenerList: ArrayList<OnChildSelectListener<Parent, Child>>)
Adapter for ParentItem used in the FilterDrawer |
var childSelectListenerList: ArrayList<OnChildSelectListener<Parent, Child>>
list of OnChildSelectListener to be called when changes happens |
fun getItemCount(): Int |
|
fun getSelectedChildren(): Map<Parent, Set<Child>>
Get the map of ParentItem to set of currently selected ChildItem |
|
fun onBindViewHolder(holder: ViewHolder, position: Int): Unit
Called when view holder request binding Leave empty as we will be using the method that receives payloads fun onBindViewHolder(holder: ViewHolder, position: Int, payloads: MutableList<Any>): Unit
Called when view holder request binding |
|
fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): ViewHolder
Inflate view and create view holder |
|
fun reset(): Unit
Reset FilterDrawer |
|
fun updateItems(parentItemList: List<Parent>): Unit
Update list of ParentItem |
const val RESET_FLAG: Int |