class ChildAdapter<Parent : ParentItem, Child : ChildItem> : Adapter<ViewHolder>
Adapter for ChildItem used in the FilterDrawer
Parent
- Your custom parent type that extends ParentItem
Child
- Your custom child type that extends ChildItem
parent
- ParentItem hosting this ChildAdapter
childItemList
- List of ChildItem
callback
- Callback to ParentItem ViewHolder when selection changes. Boolean indicates whether
Author
Camerash
See Also
ChildAdapter(parent: Parent, childItemList: List<Child>, callback: (Set<Child>, Boolean) -> Unit)
Adapter for ChildItem used in the FilterDrawer |
val childItemList: List<Child>
List of ChildItem |
|
val parent: Parent
ParentItem hosting this ChildAdapter |
fun getItemCount(): Int |
|
fun getSelectedChildSet(): Set<Child> |
|
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 child filters |
const val RESET_FLAG: Int |