Browse Source

Add fix for sideMenu.openGestureMode

yogevbd 6 years ago
parent
commit
6b5fe80091

+ 1
- 1
lib/ios/RCTConvert+SideMenuOpenGestureMode.h View File

9
 
9
 
10
 RCT_ENUM_CONVERTER(MMOpenDrawerGestureMode,
10
 RCT_ENUM_CONVERTER(MMOpenDrawerGestureMode,
11
 				   (@{@"entireScreen": @(MMOpenDrawerGestureModeAll),
11
 				   (@{@"entireScreen": @(MMOpenDrawerGestureModeAll),
12
-					  @"bezel": @(MMOpenDrawerGestureModeNone),
12
+					  @"bezel": @(MMOpenDrawerGestureModeBezelPanningCenterView),
13
 					  }), MMOpenDrawerGestureModeAll, integerValue)
13
 					  }), MMOpenDrawerGestureModeAll, integerValue)
14
 
14
 
15
 @end
15
 @end

+ 0
- 1
lib/ios/RNNSideMenuController.m View File

114
 		default:
114
 		default:
115
 			break;
115
 			break;
116
 	}
116
 	}
117
-	self.openDrawerGestureModeMask = enabled ? MMOpenDrawerGestureModeAll : MMOpenDrawerGestureModeNone;
118
 }
117
 }
119
 
118
 
120
 -(void)setControllers:(NSArray*)controllers {
119
 -(void)setControllers:(NSArray*)controllers {

+ 2
- 2
lib/ios/RNNSideMenuPresenter.m View File

31
 	if (initialOptions.sideMenu.right.width.hasValue) {
31
 	if (initialOptions.sideMenu.right.width.hasValue) {
32
 		[sideMenuController side:MMDrawerSideRight width:initialOptions.sideMenu.right.width.get];
32
 		[sideMenuController side:MMDrawerSideRight width:initialOptions.sideMenu.right.width.get];
33
 	}
33
 	}
34
-	
35
-	[sideMenuController setOpenDrawerGestureModeMask:[initialOptions.sideMenu.openGestureMode getWithDefaultValue:MMOpenDrawerGestureModeAll]];
34
+
35
+		[sideMenuController setOpenDrawerGestureModeMask:[[initialOptions.sideMenu.openGestureMode getWithDefaultValue:@(MMOpenDrawerGestureModeAll)] integerValue]];
36
 }
36
 }
37
 
37
 
38
 - (void)mergeOptions:(RNNNavigationOptions *)newOptions currentOptions:(RNNNavigationOptions *)currentOptions defaultOptions:(RNNNavigationOptions *)defaultOptions {
38
 - (void)mergeOptions:(RNNNavigationOptions *)newOptions currentOptions:(RNNNavigationOptions *)currentOptions defaultOptions:(RNNNavigationOptions *)defaultOptions {

+ 4
- 0
lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj View File

92
 		501CD320214A5B6900A6E225 /* RNNLayoutInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 501CD31E214A5B6900A6E225 /* RNNLayoutInfo.m */; };
92
 		501CD320214A5B6900A6E225 /* RNNLayoutInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 501CD31E214A5B6900A6E225 /* RNNLayoutInfo.m */; };
93
 		501E0217213E7EA3003365C5 /* RNNReactView.h in Headers */ = {isa = PBXBuildFile; fileRef = 501E0215213E7EA3003365C5 /* RNNReactView.h */; };
93
 		501E0217213E7EA3003365C5 /* RNNReactView.h in Headers */ = {isa = PBXBuildFile; fileRef = 501E0215213E7EA3003365C5 /* RNNReactView.h */; };
94
 		501E0218213E7EA3003365C5 /* RNNReactView.m in Sources */ = {isa = PBXBuildFile; fileRef = 501E0216213E7EA3003365C5 /* RNNReactView.m */; };
94
 		501E0218213E7EA3003365C5 /* RNNReactView.m in Sources */ = {isa = PBXBuildFile; fileRef = 501E0216213E7EA3003365C5 /* RNNReactView.m */; };
95
+		50206A6D21AFE75400B7BB1A /* RNNSideMenuParserTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 50206A6C21AFE75400B7BB1A /* RNNSideMenuParserTest.m */; };
95
 		50220F48212ABDFD004C2B0A /* RNNReactRootView.h in Headers */ = {isa = PBXBuildFile; fileRef = 50220F46212ABDFD004C2B0A /* RNNReactRootView.h */; };
96
 		50220F48212ABDFD004C2B0A /* RNNReactRootView.h in Headers */ = {isa = PBXBuildFile; fileRef = 50220F46212ABDFD004C2B0A /* RNNReactRootView.h */; };
96
 		50220F49212ABDFD004C2B0A /* RNNReactRootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 50220F47212ABDFD004C2B0A /* RNNReactRootView.m */; };
97
 		50220F49212ABDFD004C2B0A /* RNNReactRootView.m in Sources */ = {isa = PBXBuildFile; fileRef = 50220F47212ABDFD004C2B0A /* RNNReactRootView.m */; };
97
 		502CB46E20CD1DDA0019B2FE /* RNNBackButtonOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 502CB46C20CD1DDA0019B2FE /* RNNBackButtonOptions.h */; };
98
 		502CB46E20CD1DDA0019B2FE /* RNNBackButtonOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 502CB46C20CD1DDA0019B2FE /* RNNBackButtonOptions.h */; };
414
 		501CD31E214A5B6900A6E225 /* RNNLayoutInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNLayoutInfo.m; sourceTree = "<group>"; };
415
 		501CD31E214A5B6900A6E225 /* RNNLayoutInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNLayoutInfo.m; sourceTree = "<group>"; };
415
 		501E0215213E7EA3003365C5 /* RNNReactView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNReactView.h; sourceTree = "<group>"; };
416
 		501E0215213E7EA3003365C5 /* RNNReactView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNReactView.h; sourceTree = "<group>"; };
416
 		501E0216213E7EA3003365C5 /* RNNReactView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNReactView.m; sourceTree = "<group>"; };
417
 		501E0216213E7EA3003365C5 /* RNNReactView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNReactView.m; sourceTree = "<group>"; };
418
+		50206A6C21AFE75400B7BB1A /* RNNSideMenuParserTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNSideMenuParserTest.m; sourceTree = "<group>"; };
417
 		50220F46212ABDFD004C2B0A /* RNNReactRootView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNReactRootView.h; sourceTree = "<group>"; };
419
 		50220F46212ABDFD004C2B0A /* RNNReactRootView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNReactRootView.h; sourceTree = "<group>"; };
418
 		50220F47212ABDFD004C2B0A /* RNNReactRootView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNReactRootView.m; sourceTree = "<group>"; };
420
 		50220F47212ABDFD004C2B0A /* RNNReactRootView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNReactRootView.m; sourceTree = "<group>"; };
419
 		502CB43920CBCA140019B2FE /* RNNBridgeManagerDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNBridgeManagerDelegate.h; sourceTree = "<group>"; };
421
 		502CB43920CBCA140019B2FE /* RNNBridgeManagerDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNBridgeManagerDelegate.h; sourceTree = "<group>"; };
1015
 				509B258E2178BE7A00C83C23 /* RNNNavigationControllerPresenterTest.m */,
1017
 				509B258E2178BE7A00C83C23 /* RNNNavigationControllerPresenterTest.m */,
1016
 				502F0E172179C39900367CC3 /* RNNTabBarPresenterTest.m */,
1018
 				502F0E172179C39900367CC3 /* RNNTabBarPresenterTest.m */,
1017
 				50CE8502217C6C9B00084EBF /* RNNSideMenuPresenterTest.m */,
1019
 				50CE8502217C6C9B00084EBF /* RNNSideMenuPresenterTest.m */,
1020
+				50206A6C21AFE75400B7BB1A /* RNNSideMenuParserTest.m */,
1018
 				502F0E152178D09600367CC3 /* RNNBasePresenterTest.m */,
1021
 				502F0E152178D09600367CC3 /* RNNBasePresenterTest.m */,
1019
 				5038A378216D01F6009280BC /* RNNBottomTabOptionsTest.m */,
1022
 				5038A378216D01F6009280BC /* RNNBottomTabOptionsTest.m */,
1020
 				7B49FEBF1E95090800DEB3EA /* Info.plist */,
1023
 				7B49FEBF1E95090800DEB3EA /* Info.plist */,
1392
 				509B2480217873FF00C83C23 /* UINavigationController+RNNOptionsTest.m in Sources */,
1395
 				509B2480217873FF00C83C23 /* UINavigationController+RNNOptionsTest.m in Sources */,
1393
 				506F630D216A599300AD0D0A /* RNNTabBarControllerTest.m in Sources */,
1396
 				506F630D216A599300AD0D0A /* RNNTabBarControllerTest.m in Sources */,
1394
 				7B49FECB1E95098500DEB3EA /* RNNControllerFactoryTest.m in Sources */,
1397
 				7B49FECB1E95098500DEB3EA /* RNNControllerFactoryTest.m in Sources */,
1398
+				50206A6D21AFE75400B7BB1A /* RNNSideMenuParserTest.m in Sources */,
1395
 				509B258F2178BE7A00C83C23 /* RNNNavigationControllerPresenterTest.m in Sources */,
1399
 				509B258F2178BE7A00C83C23 /* RNNNavigationControllerPresenterTest.m in Sources */,
1396
 				7B49FECD1E95098500DEB3EA /* RNNModalManagerTest.m in Sources */,
1400
 				7B49FECD1E95098500DEB3EA /* RNNModalManagerTest.m in Sources */,
1397
 				E83BAD791F27416B00A9F3DD /* RNNRootViewControllerTest.m in Sources */,
1401
 				E83BAD791F27416B00A9F3DD /* RNNRootViewControllerTest.m in Sources */,

+ 28
- 0
lib/ios/ReactNativeNavigationTests/RNNSideMenuParserTest.m View File

1
+#import <XCTest/XCTest.h>
2
+#import "SideMenuOpenGestureModeParser.h"
3
+#import "RCTConvert+SideMenuOpenGestureMode.h"
4
+
5
+@interface RNNSideMenuParserTest : XCTestCase
6
+
7
+@end
8
+
9
+@implementation RNNSideMenuParserTest
10
+
11
+- (void)setUp {
12
+    [super setUp];
13
+}
14
+
15
+- (void)testParseBezelOpenModeReturnDrawerGestureModeBezel {
16
+	NSDictionary* dict = @{@"openMode": @"bezel"};
17
+	SideMenuOpenMode* openMode = [SideMenuOpenGestureModeParser parse:dict key:@"openMode"];
18
+	XCTAssertEqual(openMode.get.integerValue, MMOpenDrawerGestureModeBezelPanningCenterView);
19
+}
20
+
21
+- (void)testParseEntireScreenOpenModeReturnDrawerGestureModeAll {
22
+	NSDictionary* dict = @{@"openMode": @"entireScreen"};
23
+	SideMenuOpenMode* openMode = [SideMenuOpenGestureModeParser parse:dict key:@"openMode"];
24
+	XCTAssertEqual(openMode.get.integerValue, MMOpenDrawerGestureModeAll);
25
+}
26
+
27
+
28
+@end

+ 1
- 1
lib/ios/SideMenuOpenGestureModeParser.m View File

3
 
3
 
4
 @implementation SideMenuOpenGestureModeParser
4
 @implementation SideMenuOpenGestureModeParser
5
 
5
 
6
-+ (SideMenuOpenMode *)parse:(NSDictionary *)json key:(NSString *)key {	
6
++ (SideMenuOpenMode *)parse:(NSDictionary *)json key:(NSString *)key {
7
 	return json[key] ? [[SideMenuOpenMode alloc] initWithValue:@([RCTConvert MMOpenDrawerGestureMode:json[key]])] : [[SideMenuOpenMode alloc] initWithValue:nil];
7
 	return json[key] ? [[SideMenuOpenMode alloc] initWithValue:@([RCTConvert MMOpenDrawerGestureMode:json[key]])] : [[SideMenuOpenMode alloc] initWithValue:nil];
8
 }
8
 }
9
 
9
 

+ 2
- 2
lib/ios/SideMenuOpenMode.h View File

1
-#import "IntNumber.h"
1
+#import "Number.h"
2
 
2
 
3
-@interface SideMenuOpenMode : IntNumber
3
+@interface SideMenuOpenMode : Number
4
 
4
 
5
 
5
 
6
 
6
 

+ 4
- 0
lib/src/interfaces/Layout.ts View File

87
    * Set the right side bar
87
    * Set the right side bar
88
    */
88
    */
89
   right?: LayoutStackChildren;
89
   right?: LayoutStackChildren;
90
+  /**
91
+   * Set the bottom tabs options
92
+   */
93
+  options?: Options;
90
 }
94
 }
91
 
95
 
92
 export interface LayoutSplitView {
96
 export interface LayoutSplitView {