Преглед на файлове

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,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 Целия файл

@@ -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 Целия файл

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