Class

DrawerState

State of the NavigationDrawer or ModalNavigationDrawer composable.

Source set: Android
class DrawerState(initialValue: DrawerValue = DrawerValue.Closed)

State of the NavigationDrawer or ModalNavigationDrawer composable.

Parameters

initialValue the initial value (DrawerValue.Closed or DrawerValue.Open) of the drawer.

Properties

currentValue

Source set: Android
var currentValue by mutableStateOf(initialValue)

Functions

setValue

Source set: Android
fun setValue(drawerValue: DrawerValue)

Updates the state of the drawer.

Parameters

drawerValue the value the state of the drawer should be set to.

Members

Companion

Source set: Android
companion object

Properties

Saver

Source set: Android
val Saver =
            Saver<DrawerState, DrawerValue>(
                save = { it.currentValue },
                restore = { DrawerState(it) },
            )

The Saver used by rememberDrawerState to record and restore DrawerState across activity or process recreation.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: