Add drawerLockMode prop to DrawerLayoutAndroid

Summary:Closes #5270.
Closes https://github.com/facebook/react-native/pull/5534

Differential Revision: D2970771

fb-gh-sync-id: 36a814032283df7d4c469964f803b8d20d1b0c93
shipit-source-id: 36a814032283df7d4c469964f803b8d20d1b0c93
This commit is contained in:
Andreas Drivenes
2016-02-24 03:24:50 -08:00
committed by facebook-github-bot-7
parent 9ae3714f4b
commit ec173b1a17
2 changed files with 27 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ var INNERVIEW_REF = 'innerView';
var DrawerLayoutValidAttributes = {
drawerWidth: true,
drawerPosition: true,
drawerLockMode: true
};
var DRAWER_STATES = [
@@ -95,6 +96,18 @@ var DrawerLayoutAndroid = React.createClass({
* from the edge of the window.
*/
drawerWidth: ReactPropTypes.number,
/**
* Specifies the lock mode of the drawer. The drawer can be locked in 3 states:
* - unlocked (default), meaning that the drawer will respond (open/close) to touch gestures.
* - locked closed, meaning that the drawer will stay closed and not respond to gestures.
* - locked open, meaning that the drawer will stay opened and not respond to gestures.
* The drawer may still be opened and closed programmatically (`openDrawer`/`closeDrawer`).
*/
drawerLockMode: ReactPropTypes.oneOf([
'unlocked',
'locked-closed',
'locked-open'
]),
/**
* Function called whenever there is an interaction with the navigation view.
*/
@@ -142,6 +155,7 @@ var DrawerLayoutAndroid = React.createClass({
ref={RK_DRAWER_REF}
drawerWidth={this.props.drawerWidth}
drawerPosition={this.props.drawerPosition}
drawerLockMode={this.props.drawerLockMode}
style={styles.base}
onDrawerSlide={this._onDrawerSlide}
onDrawerOpen={this._onDrawerOpen}