setDrawerLockMode

open fun setDrawerLockMode(lockMode: Int)(source)

Enable or disable interaction with all drawers.

This allows the application to restrict the user's ability to open or close any drawer within this layout. DrawerLayout will still respond to calls to openDrawer, closeDrawer and friends if a drawer is locked.

Locking drawers open or closed will implicitly open or close any drawers as appropriate.

Parameters

lockMode

The new lock mode for the given drawer. One of LOCK_MODE_UNLOCKED, LOCK_MODE_LOCKED_CLOSED or LOCK_MODE_LOCKED_OPEN.


open fun setDrawerLockMode(lockMode: Int, edgeGravity: Int)(source)

Enable or disable interaction with the given drawer.

This allows the application to restrict the user's ability to open or close the given drawer. DrawerLayout will still respond to calls to openDrawer, closeDrawer and friends if a drawer is locked.

Locking a drawer open or closed will implicitly open or close that drawer as appropriate.

Parameters

lockMode

The new lock mode for the given drawer. One of LOCK_MODE_UNLOCKED, LOCK_MODE_LOCKED_CLOSED or LOCK_MODE_LOCKED_OPEN.

edgeGravity

Gravity.LEFT, RIGHT, START or END. Expresses which drawer to change the mode for.

See also


open fun setDrawerLockMode(lockMode: Int, @NonNull drawerView: View)(source)

Enable or disable interaction with the given drawer.

This allows the application to restrict the user's ability to open or close the given drawer. DrawerLayout will still respond to calls to openDrawer, closeDrawer and friends if a drawer is locked.

Locking a drawer open or closed will implicitly open or close that drawer as appropriate.

Parameters

lockMode

The new lock mode for the given drawer. One of LOCK_MODE_UNLOCKED, LOCK_MODE_LOCKED_CLOSED or LOCK_MODE_LOCKED_OPEN.

drawerView

The drawer view to change the lock mode for

See also