Browse Source

preparing to the big refactor

Ran Greenberg 7 years ago
parent
commit
3a89b66796

+ 9
- 0
ios/RCCManagerModule.m View File

@@ -172,6 +172,15 @@ RCT_EXPORT_MODULE(RCCManager);
172 172
 
173 173
 #pragma mark - RCT exported methods
174 174
 
175
+
176
+RCT_EXPORT_METHOD(
177
+startApp:(NSDictionary*)layout) {
178
+
179
+    NSLog(@"layout:%@", layout);
180
+}
181
+
182
+
183
+
175 184
 RCT_EXPORT_METHOD(
176 185
 setRootController:(NSDictionary*)layout animationType:(NSString*)animationType globalProps:(NSDictionary*)globalProps)
177 186
 {

+ 13
- 0
ios/RNNViewController.h View File

@@ -0,0 +1,13 @@
1
+//
2
+//  RNNViewController.h
3
+//  ReactNativeNavigation
4
+//
5
+//  Created by Ran Greenberg on 21/12/2016.
6
+//  Copyright © 2016 artal. All rights reserved.
7
+//
8
+
9
+#import <UIKit/UIKit.h>
10
+
11
+@interface RNNViewController : UIViewController
12
+
13
+@end

+ 19
- 0
ios/RNNViewController.m View File

@@ -0,0 +1,19 @@
1
+//
2
+//  RNNViewController.m
3
+//  ReactNativeNavigation
4
+//
5
+//  Created by Ran Greenberg on 21/12/2016.
6
+//  Copyright © 2016 artal. All rights reserved.
7
+//
8
+
9
+#import "RNNViewController.h"
10
+
11
+@interface RNNViewController ()
12
+
13
+@end
14
+
15
+@implementation RNNViewController
16
+
17
+
18
+
19
+@end

+ 6
- 0
ios/ReactNativeNavigation.xcodeproj/project.pbxproj View File

@@ -7,6 +7,7 @@
7 7
 	objects = {
8 8
 
9 9
 /* Begin PBXBuildFile section */
10
+		2606F7DA1E0BC3FC00CC69CC /* RNNViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2606F7D91E0BC3FC00CC69CC /* RNNViewController.m */; };
10 11
 		260804DB1CE0D9D20094DBA1 /* RCCToolBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 260804DA1CE0D9D20094DBA1 /* RCCToolBar.m */; };
11 12
 		26AFF3F51D7EEE2400CBA211 /* RCCTitleViewHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 26AFF3F41D7EEE2400CBA211 /* RCCTitleViewHelper.m */; };
12 13
 		CC84A19E1C1A0C4E00B3A6A2 /* RCCManager.m in Sources */ = {isa = PBXBuildFile; fileRef = CC84A1941C1A0C4E00B3A6A2 /* RCCManager.m */; };
@@ -48,6 +49,8 @@
48 49
 /* End PBXCopyFilesBuildPhase section */
49 50
 
50 51
 /* Begin PBXFileReference section */
52
+		2606F7D81E0BC3FC00CC69CC /* RNNViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNViewController.h; sourceTree = "<group>"; };
53
+		2606F7D91E0BC3FC00CC69CC /* RNNViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNViewController.m; sourceTree = "<group>"; };
51 54
 		260804D91CE0D9D20094DBA1 /* RCCToolBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCCToolBar.h; sourceTree = "<group>"; };
52 55
 		260804DA1CE0D9D20094DBA1 /* RCCToolBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCCToolBar.m; sourceTree = "<group>"; };
53 56
 		26AFF3F31D7EEE2400CBA211 /* RCCTitleViewHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCCTitleViewHelper.h; sourceTree = "<group>"; };
@@ -205,6 +208,8 @@
205 208
 				CC84A1981C1A0C4E00B3A6A2 /* RCCNavigationController.m */,
206 209
 				CC84A1991C1A0C4E00B3A6A2 /* RCCTabBarController.h */,
207 210
 				CC84A19A1C1A0C4E00B3A6A2 /* RCCTabBarController.m */,
211
+				2606F7D81E0BC3FC00CC69CC /* RNNViewController.h */,
212
+				2606F7D91E0BC3FC00CC69CC /* RNNViewController.m */,
208 213
 				CC84A19B1C1A0C4E00B3A6A2 /* RCCViewController.h */,
209 214
 				CC84A19C1C1A0C4E00B3A6A2 /* RCCViewController.m */,
210 215
 				D84813171C8C5EB700051BAF /* RCCLightBox.h */,
@@ -310,6 +315,7 @@
310 315
 				D85082E71CBCF54200FDB961 /* SidebarFlipboardAnimation.m in Sources */,
311 316
 				D85082E51CBCF54200FDB961 /* SidebarFacebookAnimation.m in Sources */,
312 317
 				CC84A1A21C1A0C4E00B3A6A2 /* RCCViewController.m in Sources */,
318
+				2606F7DA1E0BC3FC00CC69CC /* RNNViewController.m in Sources */,
313 319
 				D85082E91CBCF54200FDB961 /* SidebarWunderlistAnimation.m in Sources */,
314 320
 				D85082E11CBCF54200FDB961 /* RCCDrawerHelper.m in Sources */,
315 321
 				D85082FE1CBCF8A800FDB961 /* MMDrawerVisualState.m in Sources */,

+ 6
- 1
src/Navigation.js View File

@@ -130,6 +130,10 @@ function startSingleScreenApp(params) {
130 130
   return platformSpecific.startSingleScreenApp(params);
131 131
 }
132 132
 
133
+function startApp(layout) {
134
+    return platformSpecific.startApp(layout);
135
+}
136
+
133 137
 export default {
134 138
   getRegisteredScreen,
135 139
   registerComponent,
@@ -141,5 +145,6 @@ export default {
141 145
   showInAppNotification: showInAppNotification,
142 146
   dismissInAppNotification: dismissInAppNotification,
143 147
   startTabBasedApp: startTabBasedApp,
144
-  startSingleScreenApp: startSingleScreenApp
148
+  startSingleScreenApp: startSingleScreenApp,
149
+  startApp: startApp
145 150
 };

+ 76
- 0
src/deprecated/newParams.json View File

@@ -0,0 +1,76 @@
1
+{
2
+	"screen":{
3
+		"screen":"example.FirstTabScreen",
4
+		"title":"Navigation",
5
+		"navigatorStyle":{
6
+			"navBarBackgroundColor":"#4dbce9",
7
+			"navBarTextColor":"#ffff00",
8
+			"navBarSubtitleTextColor":"#ff0000",
9
+			"navBarButtonColor":"#ffffff",
10
+			"statusBarTextColorScheme":"light",
11
+			"tabBarBackgroundColor":"#4dbce9",
12
+			"tabBarButtonColor":"#ffffff",
13
+			"tabBarSelectedButtonColor":"#ffff00"
14
+		},
15
+		"navigatorID":"navigatorID1_nav",
16
+		"screenInstanceID":"screenInstanceID2",
17
+		"navigatorEventID":"screenInstanceID2_events",
18
+		"navigatorButtons":{
19
+			"leftButtons":[
20
+				{
21
+					"icon":"http://localhost:8081/assets/img/navicon_menu@2x.png?platform=ios&hash=940519e495eac2a6236034f2bf88ce90",
22
+					"id":"menu"
23
+				}
24
+			],
25
+			"rightButtons":[
26
+				{
27
+					"title":"Edit",
28
+					"id":"edit",
29
+					"enabled":true
30
+				},
31
+				{
32
+					"icon":"http://localhost:8081/assets/img/navicon_add@2x.png?platform=ios&hash=667fefa47fb5daebbc3943669dc6eb26",
33
+					"id":"add",
34
+					"enabled":true
35
+				}
36
+			]
37
+		},
38
+		"screenId":"example.FirstTabScreen",
39
+		"styleParams":{
40
+			"topBarColor":4283284713,
41
+			"titleBarTitleColor":4294967040,
42
+			"titleBarButtonColor":4294967295,
43
+			"drawBelowTopBar":true,
44
+			"drawScreenAboveBottomTabs":true,
45
+			"bottomTabsColor":4283284713,
46
+			"bottomTabsButtonColor":4294967295,
47
+			"bottomTabsSelectedButtonColor":4294967040
48
+		},
49
+		"navigationParams":{
50
+			"screenInstanceID":"screenInstanceID2",
51
+			"navigatorID":"navigatorID1_nav",
52
+			"navigatorEventID":"screenInstanceID2_events"
53
+		}
54
+	},
55
+	"drawer":{
56
+		"left":{
57
+			"screen":"example.SideMenu"
58
+		}
59
+	},
60
+	"appStyle":null,
61
+	"sideMenu":{
62
+		"left":{
63
+			"screenId":"example.SideMenu",
64
+			"navigatorID":"navigatorID3_nav",
65
+			"screenInstanceID":"screenInstanceID4",
66
+			"navigatorEventID":"screenInstanceID4_events",
67
+			"navigationParams":{
68
+				"screenInstanceID":"screenInstanceID4",
69
+				"navigatorID":"navigatorID3_nav",
70
+				"navigatorEventID":"screenInstanceID4_events"
71
+			}
72
+		},
73
+		"right":null
74
+	},
75
+	"animateShow":true
76
+}

+ 8
- 2
src/deprecated/platformSpecificDeprecated.ios.js View File

@@ -1,6 +1,10 @@
1 1
 /*eslint-disable*/
2 2
 import Navigation from './../Navigation';
3 3
 import Controllers, {Modal, Notification} from './controllers';
4
+import _ from 'lodash';
5
+import PropRegistry from '../PropRegistry';
6
+import * as newPlatformSpecific from './../platformSpecific';
7
+
4 8
 const React = Controllers.hijackReact();
5 9
 const {
6 10
   ControllerRegistry,
@@ -8,9 +12,10 @@ const {
8 12
   NavigationControllerIOS,
9 13
   DrawerControllerIOS
10 14
 } = React;
11
-import _ from 'lodash';
12 15
 
13
-import PropRegistry from '../PropRegistry';
16
+function startApp(layout) {
17
+	newPlatformSpecific.startApp(layout);
18
+}
14 19
 
15 20
 function startTabBasedApp(params) {
16 21
   if (!params.tabs) {
@@ -566,6 +571,7 @@ function dismissContextualMenu() {
566 571
 }
567 572
 
568 573
 export default {
574
+  startApp,
569 575
   startTabBasedApp,
570 576
   startSingleScreenApp,
571 577
   navigatorPush,

+ 15
- 1
src/platformSpecific.ios.js View File

@@ -1 +1,15 @@
1
-module.exports = {};
1
+import React, {Component} from 'react';
2
+import {AppRegistry, NativeModules} from 'react-native';
3
+import _ from 'lodash';
4
+import PropRegistry from './PropRegistry';
5
+
6
+const NativeAppMAnager = NativeModules.RCCManager;
7
+
8
+function startApp(layout) {
9
+	
10
+	NativeAppMAnager.startApp(layout);
11
+}
12
+
13
+module.exports = {
14
+	startApp
15
+};