library / com.camerash.filterdrawer / DrawerBuilder

DrawerBuilder

class DrawerBuilder<Parent : ParentItem, Child : ChildItem>

Builder for building the FilterDrawer

Parameters

Parent - Type that extends ParentItem

Child - Type that extends ChildItem

Author
Camerash

See Also

FilterDrawer

Constructors

<init>

DrawerBuilder(act: Activity)

Give builder a reference to the activity

DrawerBuilder()

Builder for building the FilterDrawer

Properties

childSelectListenerList

var childSelectListenerList: ArrayList<OnChildSelectListener<Parent, Child>>

drawerListener

var drawerListener: DrawerListener?

filterControlClickListener

var filterControlClickListener: OnFilterControlClickListener?

Functions

addChildSelectListener

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

Add a OnChildSelectListener to the FilterDrawer

appendCustomDrawer

fun appendCustomDrawer(view: View, gravity: Int): DrawerBuilder<Parent, Child>

Add a custom drawer to the layout

build

fun build(): FilterDrawer<Parent, Child>

Construct the FilterDrawer

displayToolbar

fun displayToolbar(display: Boolean): DrawerBuilder<Parent, Child>

If enabled, toolbar in FilterDrawer will be displayed

setApplyColor

fun setApplyColor(color: Int): DrawerBuilder<Parent, Child>

Set color resource for the apply button

setApplyText

fun setApplyText(text: String): DrawerBuilder<Parent, Child>

Set text for the apply button

setDisplayBelowStatusBar

fun setDisplayBelowStatusBar(enable: Boolean): DrawerBuilder<Parent, Child>

If enabled, FilterDrawer will be drawn behind status bar

setDrawerListener

fun setDrawerListener(drawerListener: DrawerListener): DrawerBuilder<Parent, Child>

Set the DrawerListener to the FilterDrawer

setDrawerLockMode

fun setDrawerLockMode(lockMode: Int): DrawerBuilder<Parent, Child>

Set the lock mode of FilterDrawer

setFilterControlClickListener

fun setFilterControlClickListener(filterControlClickListener: OnFilterControlClickListener): DrawerBuilder<Parent, Child>

Set the OnFilterControlClickListener to the FilterDrawer.

setFullscreen

fun setFullscreen(enable: Boolean): DrawerBuilder<Parent, Child>

If enabled, activity will be set to fullscreen

setGravity

fun setGravity(gravity: Int): DrawerBuilder<Parent, Child>

Set the gravity of the FilterDrawer

setResetColor

fun setResetColor(color: Int): DrawerBuilder<Parent, Child>

Set color resource for the reset button

setResetText

fun setResetText(text: String): DrawerBuilder<Parent, Child>

Set text for the reset button

setSystemUIHidden

fun setSystemUIHidden(enable: Boolean): DrawerBuilder<Parent, Child>

If enabled, system UI will be hidden

setToolbarMenu

fun setToolbarMenu(menuId: Int): DrawerBuilder<Parent, Child>

Set the menu in toolbar

setToolbarTitle

fun setToolbarTitle(title: String): DrawerBuilder<Parent, Child>

Set the title in the toolbar

setTranslucentStatusBar

fun setTranslucentStatusBar(enable: Boolean): DrawerBuilder<Parent, Child>

If enabled, status bar will be translucent

with

fun with(act: Activity): DrawerBuilder<Parent, Child>

Give builder a reference to the activity

withDrawerLayout

fun withDrawerLayout(resLayout: Int): DrawerBuilder<Parent, Child>

Define a custom layout for the drawer

withItems

fun withItems(items: Collection<Parent>): DrawerBuilder<Parent, Child>

Set the filter items