library / com.camerash.filterdrawer / FilterDrawer

FilterDrawer

class FilterDrawer<Parent : ParentItem, Child : ChildItem>

The actual FilterDrawer itself

Parameters

builder - A reference of DrawerBuilder used to build this FilterDrawer

drawerLayout - The DrawerLayout that the FilterDrawer relies on

filterView - The View of FilterDrawer

Parent - Type that extends ParentItem

Child - Type that extends ChildItem

Author
Camerash

See Also

DrawerBuilder

Types

OnChildSelectListener

interface OnChildSelectListener<Parent : ParentItem, Child : ChildItem>

Listener for events when status of ChildItem in FilterDrawer changes

OnFilterControlClickListener

interface OnFilterControlClickListener

Listener for event when FilterDrawer's control buttons are clicked

Constructors

<init>

FilterDrawer(builder: DrawerBuilder<Parent, Child>, drawerLayout: DrawerLayout, filterView: View)

The actual FilterDrawer itself

Properties

adapter

val adapter: ParentAdapter<Parent, Child>

applyBtn

val applyBtn: Button

recyclerView

val recyclerView: RecyclerView

resetBtn

val resetBtn: Button

toolbar

val toolbar: Toolbar

toolbarTitle

val toolbarTitle: TextView

Functions

addChildSelectListener

fun addChildSelectListener(childSelectListener: OnChildSelectListener<Parent, Child>): Unit

Add a OnChildSelectListener to the FilterDrawer

addDrawerListener

fun addDrawerListener(drawerListener: DrawerListener): Unit

Add a DrawerListener to the DrawerLayout

addToolbarMenuListener

fun addToolbarMenuListener(listener: OnMenuItemClickListener): Unit

Add a OnMenuItemClickListener to the toolbar

closeFilterDrawer

fun closeFilterDrawer(): Unit

Shout 'Close Sesame' to the FilterDrawer

getSelectedChildrens

fun getSelectedChildrens(): Map<Parent, Set<Child>>

Get the map of the currently selected ParentItem to Set of ChildItem

inflateToolbarMenu

fun inflateToolbarMenu(menuRes: Int): Unit

Inflate a menu inside the toolbar

openFilterDrawer

fun openFilterDrawer(): Unit

Shout 'Open Sesame' to the FilterDrawer

removeChildSelectListener

fun removeChildSelectListener(childSelectListener: OnChildSelectListener<Parent, Child>): Unit

Remove the OnChildSelectListener from the FilterDrawer

resetFilter

fun resetFilter(): Unit

Reset the FilterDrawer

setApplyColor

fun setApplyColor(color: Int): Unit

Set the color of text of the apply button in FilterDrawer

setApplyText

fun setApplyText(text: String): Unit

Set the text of the apply button in FilterDrawer

setFilterControlClickListener

fun setFilterControlClickListener(filterControlClickListener: OnFilterControlClickListener): Unit

Set the OnFilterControlClickListener to the FilterDrawer

setResetColor

fun setResetColor(color: Int): Unit

Set the color of text of the reset button in FilterDrawer

setResetText

fun setResetText(text: String): Unit

Set the text of the reset button in FilterDrawer

setToolbarTitle

fun setToolbarTitle(title: String): Unit

Set the title of the toolbar

showToolbar

fun showToolbar(show: Boolean): Unit

Set visibility of toolbar

updateItems

fun updateItems(itemList: Collection<Parent>): Unit

Update the list of filter