DrawerLayout.DrawerListener


public 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 methods

abstract void

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

abstract void

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

abstract void
onDrawerSlide(@NonNull View drawerView, float slideOffset)

Called when a drawer's position changes.

abstract void
onDrawerStateChanged(int newState)

Called when the drawer motion state changes.

Public methods

onDrawerClosed

Added in 1.0.0
abstract void onDrawerClosed(@NonNull View drawerView)

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

Parameters
@NonNull View drawerView

Drawer view that is now closed

onDrawerOpened

Added in 1.0.0
abstract void onDrawerOpened(@NonNull View drawerView)

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

Parameters
@NonNull View drawerView

Drawer view that is now open

onDrawerSlide

Added in 1.0.0
abstract void onDrawerSlide(@NonNull View drawerView, float slideOffset)

Called when a drawer's position changes.

Parameters
@NonNull View drawerView

The child view that was moved

float slideOffset

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

onDrawerStateChanged

Added in 1.0.0
abstract void onDrawerStateChanged(int newState)

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

Parameters
int newState

The new drawer motion state