|
@@ -11,109 +11,110 @@
|
11
|
11
|
- (void)applyOptions:(RNNNavigationOptions *)options {
|
12
|
12
|
[super applyOptions:options];
|
13
|
13
|
RNNNavigationOptions *withDefault = [options withDefault:[self defaultOptions]];
|
14
|
|
- RNNSideMenuController* sideMenu = self.boundViewController;
|
15
|
14
|
|
16
|
|
- [sideMenu side:MMDrawerSideLeft enabled:[withDefault.sideMenu.left.enabled getWithDefaultValue:YES]];
|
17
|
|
- [sideMenu side:MMDrawerSideRight enabled:[withDefault.sideMenu.right.enabled getWithDefaultValue:YES]];
|
|
15
|
+ [self.sideMenuController side:MMDrawerSideLeft enabled:[withDefault.sideMenu.left.enabled getWithDefaultValue:YES]];
|
|
16
|
+ [self.sideMenuController side:MMDrawerSideRight enabled:[withDefault.sideMenu.right.enabled getWithDefaultValue:YES]];
|
18
|
17
|
|
19
|
|
- [sideMenu setShouldStretchLeftDrawer:[withDefault.sideMenu.left.shouldStretchDrawer getWithDefaultValue:YES]];
|
20
|
|
- [sideMenu setShouldStretchRightDrawer:[withDefault.sideMenu.right.shouldStretchDrawer getWithDefaultValue:YES]];
|
|
18
|
+ [self.sideMenuController setShouldStretchLeftDrawer:[withDefault.sideMenu.left.shouldStretchDrawer getWithDefaultValue:YES]];
|
|
19
|
+ [self.sideMenuController setShouldStretchRightDrawer:[withDefault.sideMenu.right.shouldStretchDrawer getWithDefaultValue:YES]];
|
21
|
20
|
|
22
|
|
- [sideMenu setAnimationVelocityLeft:[withDefault.sideMenu.left.animationVelocity getWithDefaultValue:840.0f]];
|
23
|
|
- [sideMenu setAnimationVelocityRight:[withDefault.sideMenu.right.animationVelocity getWithDefaultValue:840.0f]];
|
|
21
|
+ [self.sideMenuController setAnimationVelocityLeft:[withDefault.sideMenu.left.animationVelocity getWithDefaultValue:840.0f]];
|
|
22
|
+ [self.sideMenuController setAnimationVelocityRight:[withDefault.sideMenu.right.animationVelocity getWithDefaultValue:840.0f]];
|
24
|
23
|
|
25
|
|
- [sideMenu setAnimationType:[withDefault.sideMenu.animationType getWithDefaultValue:nil]];
|
|
24
|
+ [self.sideMenuController setAnimationType:[withDefault.sideMenu.animationType getWithDefaultValue:nil]];
|
26
|
25
|
|
27
|
26
|
if (withDefault.sideMenu.left.width.hasValue) {
|
28
|
|
- [sideMenu side:MMDrawerSideLeft width:withDefault.sideMenu.left.width.get];
|
|
27
|
+ [self.sideMenuController side:MMDrawerSideLeft width:withDefault.sideMenu.left.width.get];
|
29
|
28
|
}
|
30
|
29
|
|
31
|
30
|
if (withDefault.sideMenu.right.width.hasValue) {
|
32
|
|
- [sideMenu side:MMDrawerSideRight width:withDefault.sideMenu.right.width.get];
|
|
31
|
+ [self.sideMenuController side:MMDrawerSideRight width:withDefault.sideMenu.right.width.get];
|
33
|
32
|
}
|
34
|
33
|
|
35
|
34
|
if (withDefault.sideMenu.left.visible.hasValue) {
|
36
|
|
- [sideMenu side:MMDrawerSideLeft visible:withDefault.sideMenu.left.visible.get];
|
|
35
|
+ [self.sideMenuController side:MMDrawerSideLeft visible:withDefault.sideMenu.left.visible.get];
|
37
|
36
|
[withDefault.sideMenu.left.visible consume];
|
38
|
37
|
}
|
39
|
38
|
|
40
|
39
|
if (withDefault.sideMenu.right.visible.hasValue) {
|
41
|
|
- [sideMenu side:MMDrawerSideRight visible:withDefault.sideMenu.right.visible.get];
|
|
40
|
+ [self.sideMenuController side:MMDrawerSideRight visible:withDefault.sideMenu.right.visible.get];
|
42
|
41
|
[withDefault.sideMenu.right.visible consume];
|
43
|
42
|
}
|
44
|
43
|
|
45
|
|
- [sideMenu.view setBackgroundColor:[withDefault.layout.backgroundColor getWithDefaultValue:nil]];
|
|
44
|
+ [self.sideMenuController.view setBackgroundColor:[withDefault.layout.backgroundColor getWithDefaultValue:nil]];
|
46
|
45
|
}
|
47
|
46
|
|
48
|
47
|
- (void)applyOptionsOnInit:(RNNNavigationOptions *)initialOptions {
|
49
|
48
|
[super applyOptionsOnInit:initialOptions];
|
50
|
49
|
|
51
|
50
|
RNNNavigationOptions *withDefault = [initialOptions withDefault:[self defaultOptions]];
|
52
|
|
- RNNSideMenuController* sideMenu = self.boundViewController;
|
53
|
51
|
if (withDefault.sideMenu.left.width.hasValue) {
|
54
|
|
- [sideMenu side:MMDrawerSideLeft width:withDefault.sideMenu.left.width.get];
|
|
52
|
+ [self.sideMenuController side:MMDrawerSideLeft width:withDefault.sideMenu.left.width.get];
|
55
|
53
|
}
|
56
|
54
|
|
57
|
55
|
if (withDefault.sideMenu.right.width.hasValue) {
|
58
|
|
- [sideMenu side:MMDrawerSideRight width:withDefault.sideMenu.right.width.get];
|
|
56
|
+ [self.sideMenuController side:MMDrawerSideRight width:withDefault.sideMenu.right.width.get];
|
59
|
57
|
}
|
60
|
58
|
|
61
|
|
- [sideMenu setOpenDrawerGestureModeMask:[[withDefault.sideMenu.openGestureMode getWithDefaultValue:@(MMOpenDrawerGestureModeAll)] integerValue]];
|
|
59
|
+ [self.sideMenuController setOpenDrawerGestureModeMask:[[withDefault.sideMenu.openGestureMode getWithDefaultValue:@(MMOpenDrawerGestureModeAll)] integerValue]];
|
62
|
60
|
}
|
63
|
61
|
|
64
|
62
|
- (void)mergeOptions:(RNNNavigationOptions *)options resolvedOptions:(RNNNavigationOptions *)currentOptions {
|
65
|
63
|
[super mergeOptions:options resolvedOptions:currentOptions];
|
66
|
|
- RNNSideMenuController* sideMenu = self.boundViewController;
|
67
|
64
|
|
68
|
65
|
if (options.sideMenu.left.enabled.hasValue) {
|
69
|
|
- [sideMenu side:MMDrawerSideLeft enabled:options.sideMenu.left.enabled.get];
|
|
66
|
+ [self.sideMenuController side:MMDrawerSideLeft enabled:options.sideMenu.left.enabled.get];
|
70
|
67
|
}
|
71
|
68
|
|
72
|
69
|
if (options.sideMenu.right.enabled.hasValue) {
|
73
|
|
- [sideMenu side:MMDrawerSideRight enabled:options.sideMenu.right.enabled.get];
|
|
70
|
+ [self.sideMenuController side:MMDrawerSideRight enabled:options.sideMenu.right.enabled.get];
|
74
|
71
|
}
|
75
|
72
|
|
76
|
73
|
if (options.sideMenu.left.visible.hasValue) {
|
77
|
|
- [sideMenu side:MMDrawerSideLeft visible:options.sideMenu.left.visible.get];
|
|
74
|
+ [self.sideMenuController side:MMDrawerSideLeft visible:options.sideMenu.left.visible.get];
|
78
|
75
|
[options.sideMenu.left.visible consume];
|
79
|
76
|
}
|
80
|
77
|
|
81
|
78
|
if (options.sideMenu.right.visible.hasValue) {
|
82
|
|
- [sideMenu side:MMDrawerSideRight visible:options.sideMenu.right.visible.get];
|
|
79
|
+ [self.sideMenuController side:MMDrawerSideRight visible:options.sideMenu.right.visible.get];
|
83
|
80
|
[options.sideMenu.right.visible consume];
|
84
|
81
|
}
|
85
|
82
|
|
86
|
83
|
if (options.sideMenu.left.width.hasValue) {
|
87
|
|
- [sideMenu side:MMDrawerSideLeft width:options.sideMenu.left.width.get];
|
|
84
|
+ [self.sideMenuController side:MMDrawerSideLeft width:options.sideMenu.left.width.get];
|
88
|
85
|
}
|
89
|
86
|
|
90
|
87
|
if (options.sideMenu.right.width.hasValue) {
|
91
|
|
- [sideMenu side:MMDrawerSideRight width:options.sideMenu.right.width.get];
|
|
88
|
+ [self.sideMenuController side:MMDrawerSideRight width:options.sideMenu.right.width.get];
|
92
|
89
|
}
|
93
|
90
|
|
94
|
91
|
if (options.sideMenu.left.shouldStretchDrawer.hasValue) {
|
95
|
|
- sideMenu.shouldStretchLeftDrawer = options.sideMenu.left.shouldStretchDrawer.get;
|
|
92
|
+ self.sideMenuController.shouldStretchLeftDrawer = options.sideMenu.left.shouldStretchDrawer.get;
|
96
|
93
|
}
|
97
|
94
|
|
98
|
95
|
if (options.sideMenu.right.shouldStretchDrawer.hasValue) {
|
99
|
|
- sideMenu.shouldStretchRightDrawer = options.sideMenu.right.shouldStretchDrawer.get;
|
|
96
|
+ self.sideMenuController.shouldStretchRightDrawer = options.sideMenu.right.shouldStretchDrawer.get;
|
100
|
97
|
}
|
101
|
98
|
|
102
|
99
|
if (options.sideMenu.left.animationVelocity.hasValue) {
|
103
|
|
- sideMenu.animationVelocityLeft = options.sideMenu.left.animationVelocity.get;
|
|
100
|
+ self.sideMenuController.animationVelocityLeft = options.sideMenu.left.animationVelocity.get;
|
104
|
101
|
}
|
105
|
102
|
|
106
|
103
|
if (options.sideMenu.right.animationVelocity.hasValue) {
|
107
|
|
- sideMenu.animationVelocityRight = options.sideMenu.right.animationVelocity.get;
|
|
104
|
+ self.sideMenuController.animationVelocityRight = options.sideMenu.right.animationVelocity.get;
|
108
|
105
|
}
|
109
|
106
|
|
110
|
107
|
if (options.sideMenu.animationType.hasValue) {
|
111
|
|
- [sideMenu setAnimationType:options.sideMenu.animationType.get];
|
|
108
|
+ [self.sideMenuController setAnimationType:options.sideMenu.animationType.get];
|
112
|
109
|
}
|
113
|
110
|
|
114
|
111
|
if (options.layout.backgroundColor.hasValue) {
|
115
|
|
- [sideMenu.view setBackgroundColor:options.layout.backgroundColor.get];
|
|
112
|
+ [self.sideMenuController.view setBackgroundColor:options.layout.backgroundColor.get];
|
116
|
113
|
}
|
117
|
114
|
}
|
118
|
115
|
|
|
116
|
+- (RNNSideMenuController *)sideMenuController {
|
|
117
|
+ return (RNNSideMenuController *)self.boundViewController;
|
|
118
|
+}
|
|
119
|
+
|
119
|
120
|
@end
|