Browse Source

added setStackRoot animation support (#3722)

Yogev Ben David 6 years ago
parent
commit
2e02f78da6
No account linked to committer's email address

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

142
 	RNNNavigationOptions* options = [newVC getLeafViewController].options;
142
 	RNNNavigationOptions* options = [newVC getLeafViewController].options;
143
 	UIViewController *fromVC = [_store findComponentForId:componentId];
143
 	UIViewController *fromVC = [_store findComponentForId:componentId];
144
 	__weak typeof(RNNEventEmitter*) weakEventEmitter = _eventEmitter;
144
 	__weak typeof(RNNEventEmitter*) weakEventEmitter = _eventEmitter;
145
-	[_stackManager setStackRoot:newVC fromViewController:fromVC animated:options.animations.push.enable completion:^{
145
+	[_stackManager setStackRoot:newVC fromViewController:fromVC animated:options.animations.setStackRoot.enable completion:^{
146
 		[weakEventEmitter sendOnNavigationCommandCompletion:setStackRoot params:@{@"componentId": componentId}];
146
 		[weakEventEmitter sendOnNavigationCommandCompletion:setStackRoot params:@{@"componentId": componentId}];
147
 		completion();
147
 		completion();
148
 	} rejection:rejection];
148
 	} rejection:rejection];

+ 1
- 0
lib/ios/RNNTransitionsOptions.h View File

8
 @property (nonatomic, strong) RNNScreenTransition* pop;
8
 @property (nonatomic, strong) RNNScreenTransition* pop;
9
 @property (nonatomic, strong) RNNScreenTransition* showModal;
9
 @property (nonatomic, strong) RNNScreenTransition* showModal;
10
 @property (nonatomic, strong) RNNScreenTransition* dismissModal;
10
 @property (nonatomic, strong) RNNScreenTransition* dismissModal;
11
+@property (nonatomic, strong) RNNScreenTransition* setStackRoot;
11
 
12
 
12
 @end
13
 @end

+ 5
- 1
playground/src/screens/PushedScreen.js View File

177
           previousScreenIds: _.concat([], this.props.previousScreenIds || [], this.props.componentId)
177
           previousScreenIds: _.concat([], this.props.previousScreenIds || [], this.props.componentId)
178
         },
178
         },
179
         options: {
179
         options: {
180
-          animated: true,
180
+          animations: {
181
+            setStackRoot: {
182
+              enable: false
183
+            }
184
+          },
181
           topBar: {
185
           topBar: {
182
             title: {
186
             title: {
183
               text: `Pushed ${this.getStackPosition() + 1}`
187
               text: `Pushed ${this.getStackPosition() + 1}`