DrawerLayout.DrawerListener


interface DrawerLayout.DrawerListener

Known direct subclasses
ActionBarDrawerToggle

This class provides a handy way to tie together the functionality of DrawerLayout and the framework ActionBar to implement the recommended design for navigation drawers.

DrawerLayout.SimpleDrawerListener

Stub/no-op implementations of all methods of DrawerListener.


Listener for monitoring events about drawers.

Summary

Public functions

Unit
onDrawerClosed(drawerView: View)

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

Unit
onDrawerOpened(drawerView: View)

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

Unit
onDrawerSlide(drawerView: View, slideOffset: Float)

Called when a drawer's position changes.

Unit

Called when the drawer motion state changes.

Public functions

onDrawerClosed

Added in 1.0.0
fun onDrawerClosed(drawerView: View): Unit

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

Parameters
drawerView: View

Drawer view that is now closed

onDrawerOpened

Added in 1.0.0
fun onDrawerOpened(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

Added in 1.0.0
fun onDrawerSlide(drawerView: View, slideOffset: Float): Unit

Called when a drawer's position changes.

Parameters
drawerView: View

The child view that was moved

slideOffset: Float

The new offset of this drawer within its range, from 0-1

onDrawerStateChanged

Added in 1.0.0
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