Kaynağa Gözat

added setStackRoot animation support (#3722)

Yogev Ben David 6 yıl önce
ebeveyn
işleme
2e02f78da6
No account linked to committer's email address

+ 1
- 1
lib/ios/RNNCommandsHandler.m Dosyayı Görüntüle

@@ -142,7 +142,7 @@ static NSString* const setDefaultOptions	= @"setDefaultOptions";
142 142
 	RNNNavigationOptions* options = [newVC getLeafViewController].options;
143 143
 	UIViewController *fromVC = [_store findComponentForId:componentId];
144 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 146
 		[weakEventEmitter sendOnNavigationCommandCompletion:setStackRoot params:@{@"componentId": componentId}];
147 147
 		completion();
148 148
 	} rejection:rejection];

+ 1
- 0
lib/ios/RNNTransitionsOptions.h Dosyayı Görüntüle

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

+ 5
- 1
playground/src/screens/PushedScreen.js Dosyayı Görüntüle

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