(Android) Allow disableOpenGesture right or left in the drawer#2189
Merged
Conversation
Hello! This is my first pull request here so apologize if I made any mistakes. I'm working on my first React Native project and thought I could solve this problem that can happen to other people.
This pull request allows you to disable the open gesture only in one side of the drawer. In my current application, I want to have 2 drawers (on both sides). The left drawer is always enabled. The right drawer is only enable in one screen.
This way I can startSingleScreenApp() and pass the two drawers, but only the left would be 'enabled':
```
Navigation.startSingleScreenApp({
screen: initialScreen,
drawer: {
left: {
screen: DRAWER_SCREEN,
disableOpenGesture: false,
},
right: {
screen: SIDEBAR_FILTER_SCREEN,
disableOpenGesture: true,
},
},
});
```
If we pass disableOpenGesture to the drawer root object, like this:
```
Navigation.startSingleScreenApp({
screen: initialScreen,
drawer: {
left: {
screen: DRAWER_SCREEN,
disableOpenGesture: false,
},
right: {
screen: SIDEBAR_FILTER_SCREEN,
disableOpenGesture: true,
},
disableOpenGesture: true <======
},
});
```
Then the two drawer positions would be gesture disabled and the specific disableOpenGesture would be ignored. This way we don`t introduce breaking changes.
What do you guys think?
Collaborator
|
Thanks for the PR Ricardo, I'll get to it by the end of the week. Can you please update the docs as well? |
Contributor
Author
|
Hey @guyca, I`ve just updated the docs! |
thanhzusu
pushed a commit
to thanhzusu/react-native-navigation
that referenced
this pull request
Nov 27, 2017
* master: (22 commits) setTabButton to change the label of the TabButton (wix#2215) 3D Touch Preview API (wix#2186) Update android-specific-use-cases.md Update android-specific-use-cases.md Load props from props registry for redux screens Nav bar save props (wix#2211) Support passing unserializable props to custom navBar component Save buttons props for root screens Ensure that styles set on individual buttons are not overridden (wix#2200) Update top-level-api.md (Android) Allow disableOpenGesture right or left in the drawer (wix#2189) Revert "Support iOS 11 prefersLargeTitles #1643 (wix#2090)" (wix#2204) Support iOS 11 prefersLargeTitles #1643 (wix#2090) Support passing unserializable props to custom button (wix#2192) addOnNavigatorEvent improvements (wix#2175) Fix missing props (wix#2179) Revert "Don't custom button props over the bridge (wix#2174)" (wix#2177) Don't custom button props over the bridge (wix#2174) Set missing TopBar background color Register multiple navigatorEventListeners (wix#2173) ...
garrettm
pushed a commit
to Ginger-Labs/react-native-navigation
that referenced
this pull request
Dec 19, 2017
) This pull request allows you to disable the open gesture only in one side of the drawer. ``` Navigation.startSingleScreenApp({ screen: initialScreen, drawer: { left: { screen: DRAWER_SCREEN, disableOpenGesture: false, }, right: { screen: SIDEBAR_FILTER_SCREEN, disableOpenGesture: true, }, }, }); ``` If we pass disableOpenGesture to the drawer root object, like this: ``` Navigation.startSingleScreenApp({ screen: initialScreen, drawer: { left: { screen: DRAWER_SCREEN, disableOpenGesture: false, }, right: { screen: SIDEBAR_FILTER_SCREEN, disableOpenGesture: true, }, disableOpenGesture: true <====== }, }); ``` Then the two drawer positions would be gesture disabled and the specific disableOpenGesture would be ignored. This way we don`t introduce breaking changes.
garrettm
pushed a commit
to Ginger-Labs/react-native-navigation
that referenced
this pull request
Dec 19, 2017
) This pull request allows you to disable the open gesture only in one side of the drawer. ``` Navigation.startSingleScreenApp({ screen: initialScreen, drawer: { left: { screen: DRAWER_SCREEN, disableOpenGesture: false, }, right: { screen: SIDEBAR_FILTER_SCREEN, disableOpenGesture: true, }, }, }); ``` If we pass disableOpenGesture to the drawer root object, like this: ``` Navigation.startSingleScreenApp({ screen: initialScreen, drawer: { left: { screen: DRAWER_SCREEN, disableOpenGesture: false, }, right: { screen: SIDEBAR_FILTER_SCREEN, disableOpenGesture: true, }, disableOpenGesture: true <====== }, }); ``` Then the two drawer positions would be gesture disabled and the specific disableOpenGesture would be ignored. This way we don`t introduce breaking changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello! This is my first pull request here so apologize if I made any mistakes. I'm working on my first React Native project and thought I could solve this problem that can happen to other people.
This pull request allows you to disable the open gesture only in one side of the drawer. In my current application, I want to have 2 drawers (on both sides). The left drawer is always enabled. The right drawer is only enabled in one screen.
This way I can startSingleScreenApp() and pass the two drawers, but only the left would be 'enabled':
If we pass disableOpenGesture to the drawer root object, like this:
Then the two drawer positions would be gesture disabled and the specific disableOpenGesture would be ignored.
What do you guys think?