# DrawerLayout.SimpleDrawerListener

# DrawerLayout.SimpleDrawerListener

Artifact:[androidx.drawerlayout:drawerlayout](https://developer.android.com/jetpack/androidx/releases/drawerlayout)  
[View Source](https://cs.android.com/search?q=file:androidx/drawerlayout/widget/DrawerLayout.java+class:androidx.drawerlayout.widget.DrawerLayout.SimpleDrawerListener)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/drawerlayout#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/drawerlayout/widget/DrawerLayout.SimpleDrawerListener "View this page in Java")

<br />

```
abstract class DrawerLayout.SimpleDrawerListener : DrawerLayout.DrawerListener
```

<br />

*** ** * ** ***

Stub/no-op implementations of all methods of[DrawerListener](https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout.DrawerListener). Override this if you only care about a few of the available callback methods.

## Summary

|                                                                     ### Public constructors                                                                      |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SimpleDrawerListener](https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout.SimpleDrawerListener#SimpleDrawerListener())`()` |

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDrawerClosed](https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout.SimpleDrawerListener#onDrawerClosed(android.view.View))`(drawerView: `[View](https://developer.android.com/reference/android/view/View.html)`)` Called when a drawer has settled in a completely closed state.                                                                               |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDrawerOpened](https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout.SimpleDrawerListener#onDrawerOpened(android.view.View))`(drawerView: `[View](https://developer.android.com/reference/android/view/View.html)`)` Called when a drawer has settled in a completely open state.                                                                                 |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDrawerSlide](https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout.SimpleDrawerListener#onDrawerSlide(android.view.View,float))`(drawerView: `[View](https://developer.android.com/reference/android/view/View.html)`, slideOffset: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Called when a drawer's position changes. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDrawerStateChanged](https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout.SimpleDrawerListener#onDrawerStateChanged(int))`(newState: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Called when the drawer motion state changes.                                                                                                |

## Public constructors

### SimpleDrawerListener

Added in 1.0.0  

```
SimpleDrawerListener()
```  

## Public functions

### onDrawerClosed

Added in[1.3.0-alpha01](https://developer.android.com/jetpack/androidx/releases/drawerlayout#1.3.0-alpha01)  

```
fun onDrawerClosed(drawerView: View): Unit
```

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

|                                      Parameters                                      |
|--------------------------------------------------------------------------------------|--------------------------------|
| `drawerView: `[View](https://developer.android.com/reference/android/view/View.html) | Drawer view that is now closed |

### onDrawerOpened

Added in[1.3.0-alpha01](https://developer.android.com/jetpack/androidx/releases/drawerlayout#1.3.0-alpha01)  

```
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](https://developer.android.com/reference/android/view/View.html) | Drawer view that is now open |

### onDrawerSlide

Added in[1.3.0-alpha01](https://developer.android.com/jetpack/androidx/releases/drawerlayout#1.3.0-alpha01)  

```
fun onDrawerSlide(drawerView: View, slideOffset: Float): Unit
```

Called when a drawer's position changes.  

|                                           Parameters                                           |
|------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| `drawerView: `[View](https://developer.android.com/reference/android/view/View.html)           | The child view that was moved                            |
| `slideOffset: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | The new offset of this drawer within its range, from 0-1 |

### onDrawerStateChanged

Added in[1.3.0-alpha01](https://developer.android.com/jetpack/androidx/releases/drawerlayout#1.3.0-alpha01)  

```
fun onDrawerStateChanged(newState: Int): Unit
```

Called when the drawer motion state changes. The new state will be one of[STATE_IDLE](https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout#STATE_IDLE()),[STATE_DRAGGING](https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout#STATE_DRAGGING())or[STATE_SETTLING](https://developer.android.com/reference/kotlin/androidx/drawerlayout/widget/DrawerLayout#STATE_SETTLING()).  

|                                       Parameters                                        |
|-----------------------------------------------------------------------------------------|-----------------------------|
| `newState: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The new drawer motion state |