Selaa lähdekoodia

Add fix for sideMenu.openGestureMode

yogevbd 6 vuotta sitten
vanhempi
commit
6b5fe80091

+ 1
- 1
lib/ios/RCTConvert+SideMenuOpenGestureMode.h Näytä tiedosto

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

+ 0
- 1
lib/ios/RNNSideMenuController.m Näytä tiedosto

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

+ 2
- 2
lib/ios/RNNSideMenuPresenter.m Näytä tiedosto

@@ -31,8 +31,8 @@
31 31
 	if (initialOptions.sideMenu.right.width.hasValue) {
32 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 38
 - (void)mergeOptions:(RNNNavigationOptions *)newOptions currentOptions:(RNNNavigationOptions *)currentOptions defaultOptions:(RNNNavigationOptions *)defaultOptions {

+ 4
- 0
lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj Näytä tiedosto

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

+ 28
- 0
lib/ios/ReactNativeNavigationTests/RNNSideMenuParserTest.m Näytä tiedosto

@@ -0,0 +1,28 @@
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 Näytä tiedosto

@@ -3,7 +3,7 @@
3 3
 
4 4
 @implementation SideMenuOpenGestureModeParser
5 5
 
6
-+ (SideMenuOpenMode *)parse:(NSDictionary *)json key:(NSString *)key {	
6
++ (SideMenuOpenMode *)parse:(NSDictionary *)json key:(NSString *)key {
7 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 Näytä tiedosto

@@ -1,6 +1,6 @@
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 Näytä tiedosto

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