-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sideMenu.openGestureMode option (#4348)
Until now controlling drawers touch gestures was impossible, drawers received gesture opening touch from the entire screen and that causes collisions with other gestures (which are implemented on the javascript side). This commit adding modes for how sideMenu drawers gestures will receive opening touch. ``` { sideMenu: { openGestureMode: 'entireScreen' | 'bezel' } } ``` - `entireScreen`: drawer gesture will trigger drawer opening from the entire screen - `bezel`: drawer gesture will trigger drawer opening only from the center screen bezel frame The default didn't change.
- Loading branch information
Showing
13 changed files
with
93 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#import <React/RCTConvert.h> | ||
#import "MMDrawerController.h" | ||
|
||
@interface RCTConvert (SideMenuOpenGestureMode) | ||
|
||
@end | ||
|
||
@implementation RCTConvert (SideMenuOpenGestureMode) | ||
|
||
RCT_ENUM_CONVERTER(MMOpenDrawerGestureMode, | ||
(@{@"entireScreen": @(MMOpenDrawerGestureModeAll), | ||
@"bezel": @(MMOpenDrawerGestureModeNone), | ||
}), MMOpenDrawerGestureModeAll, integerValue) | ||
|
||
@end | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
#import "RNNOptions.h" | ||
#import "RNNSideMenuSideOptions.h" | ||
#import "SideMenuOpenMode.h" | ||
|
||
@interface RNNSideMenuOptions : RNNOptions | ||
|
||
@property (nonatomic, strong) RNNSideMenuSideOptions* left; | ||
@property (nonatomic, strong) RNNSideMenuSideOptions* right; | ||
|
||
@property (nonatomic, strong) Text* animationType; | ||
@property (nonatomic, strong) SideMenuOpenMode* openGestureMode; | ||
|
||
@end |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#import <Foundation/Foundation.h> | ||
#import "SideMenuOpenMode.h" | ||
|
||
@interface SideMenuOpenGestureModeParser : NSObject | ||
|
||
+ (SideMenuOpenMode *)parse:(NSDictionary *)json key:(NSString *)key; | ||
|
||
@end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#import "SideMenuOpenGestureModeParser.h" | ||
#import "RCTConvert+SideMenuOpenGestureMode.h" | ||
|
||
@implementation SideMenuOpenGestureModeParser | ||
|
||
+ (SideMenuOpenMode *)parse:(NSDictionary *)json key:(NSString *)key { | ||
return json[key] ? [[SideMenuOpenMode alloc] initWithValue:@([RCTConvert MMOpenDrawerGestureMode:json[key]])] : [[SideMenuOpenMode alloc] initWithValue:nil]; | ||
} | ||
|
||
@end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#import "IntNumber.h" | ||
|
||
@interface SideMenuOpenMode : IntNumber | ||
|
||
|
||
|
||
@end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#import "SideMenuOpenMode.h" | ||
|
||
@implementation SideMenuOpenMode | ||
|
||
@end |
This file contains 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
0a4bf2a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yogevbd this should work with the latest
master
, right? I'm asking b/c it isn't working for me :(