瀏覽代碼

added setStackRoot animation support (#3722)

Yogev Ben David 6 年之前
父節點
當前提交
2e02f78da6
No account linked to committer's email address
共有 3 個檔案被更改,包括 7 行新增2 行删除
  1. 1
    1
      lib/ios/RNNCommandsHandler.m
  2. 1
    0
      lib/ios/RNNTransitionsOptions.h
  3. 5
    1
      playground/src/screens/PushedScreen.js

+ 1
- 1
lib/ios/RNNCommandsHandler.m 查看文件

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 查看文件

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 查看文件

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}`