Browse Source

support transition animations on root changes

talkol 8 years ago
parent
commit
713ca27da5

+ 4
- 2
README.md View File

151
     right: { // optional, define if you want a drawer from the right
151
     right: { // optional, define if you want a drawer from the right
152
       screen: 'example.SecondSideMenu' // unique ID registered with Navigation.registerScreen
152
       screen: 'example.SecondSideMenu' // unique ID registered with Navigation.registerScreen
153
     }
153
     }
154
-  }
154
+  },
155
+  animationType: 'slide-down' // optional, add transition animation to root change: 'none', 'slide-down', 'fade'
155
 });
156
 });
156
 ```
157
 ```
157
 
158
 
173
     right: { // optional, define if you want a drawer from the right
174
     right: { // optional, define if you want a drawer from the right
174
       screen: 'example.SecondSideMenu' // unique ID registered with Navigation.registerScreen
175
       screen: 'example.SecondSideMenu' // unique ID registered with Navigation.registerScreen
175
     }
176
     }
176
-  }
177
+  },
178
+  animationType: 'slide-down' // optional, add transition animation to root change: 'none', 'slide-down', 'fade'
177
 });
179
 });
178
 ```
180
 ```
179
 
181
 

+ 1
- 1
example-redux/ios/exampleRedux/AppDelegate.m View File

24
   // **********************************************
24
   // **********************************************
25
   self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
25
   self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
26
   self.window.backgroundColor = [UIColor whiteColor];
26
   self.window.backgroundColor = [UIColor whiteColor];
27
-  [[RCCManager sharedIntance] initBridgeWithBundleURL:jsCodeLocation];
27
+  [[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation];
28
   
28
   
29
   /*
29
   /*
30
    // original RN bootstrap - remove this part
30
    // original RN bootstrap - remove this part

+ 2
- 1
example-redux/src/app.js View File

60
               title: 'Screen Two',
60
               title: 'Screen Two',
61
               navigatorStyle: {}
61
               navigatorStyle: {}
62
             }
62
             }
63
-          ]
63
+          ],
64
+          animationType: 'slide-down'
64
         });
65
         });
65
         return;
66
         return;
66
       default:
67
       default:

+ 2
- 2
src/platformSpecific.ios.js View File

76
     }
76
     }
77
   });
77
   });
78
   ControllerRegistry.registerController(controllerID, () => Controller);
78
   ControllerRegistry.registerController(controllerID, () => Controller);
79
-  ControllerRegistry.setRootController(controllerID);
79
+  ControllerRegistry.setRootController(controllerID, params.animationType);
80
 }
80
 }
81
 
81
 
82
 function startSingleScreenApp(params) {
82
 function startSingleScreenApp(params) {
134
     }
134
     }
135
   });
135
   });
136
   ControllerRegistry.registerController(controllerID, () => Controller);
136
   ControllerRegistry.registerController(controllerID, () => Controller);
137
-  ControllerRegistry.setRootController(controllerID);
137
+  ControllerRegistry.setRootController(controllerID, params.animationType);
138
 }
138
 }
139
 
139
 
140
 function _mergeScreenSpecificSettings(screenID, screenInstanceID, params) {
140
 function _mergeScreenSpecificSettings(screenID, screenInstanceID, params) {