DrawerListener

interface DrawerListener
androidx.drawerlayout.widget.DrawerLayout.DrawerListener

Listener for monitoring events about drawers.

Summary

Public methods

abstract Unit
onDrawerClosed(@NonNull drawerView: View)

Called when a drawer has settled in a completely closed state.

abstract Unit
onDrawerOpened(@NonNull drawerView: View)

Called when a drawer has settled in a completely open state.

abstract Unit
onDrawerSlide(@NonNull drawerView: View, slideOffset: Float)

Called when a drawer's position changes.

abstract Unit

Called when the drawer motion state changes.

Public methods

onDrawerClosed

abstract fun onDrawerClosed(@NonNull drawerView: View): Unit

Called when a drawer has settled in a completely closed state.

Parameters
drawerView View: Drawer view that is now closed

onDrawerOpened

abstract fun onDrawerOpened(@NonNull drawerView: View): Unit

Called when a drawer has settled in a completely open state. The drawer is interactive at this point.

Parameters
drawerView View: Drawer view that is now open

onDrawerSlide

abstract fun onDrawerSlide(@NonNull drawerView: View, slideOffset: Float): Unit

Called when a drawer's position changes.

Parameters
drawerView View: The child view that was moved
slideOffset View: The new offset of this drawer within its range, from 0-1

onDrawerStateChanged

abstract fun onDrawerStateChanged(newState: Int): Unit

Called when the drawer motion state changes. The new state will be one of STATE_IDLE, STATE_DRAGGING or STATE_SETTLING.

Parameters
newState Int: The new drawer motion state