drawerStateChanges

Create a InitialValueFlow of drawer state change events on the DrawerLayout instance where the value emitted is a boolean representing whether the drawer is opened or closed.

Parameters

gravity

the gravity of the DrawerLayout to observer.

Note: Created flow keeps a strong reference to the DrawerLayout instance until the coroutine that launched the flow collector is cancelled.

Example of usage:

drawerLayout.drawerStateChanges()
.onEach { sate ->
// handle drawer opened / closed
}
.launchIn(uiScope)