ソースを参照

rename container->component android

Daniel Zlotin 7 年 前
コミット
b2ade91ee7
共有43 個のファイルを変更した313 個の追加313 個の削除を含む
  1. 27
    27
      lib/android/app/src/main/java/com/reactnativenavigation/anim/StackAnimator.java
  2. 18
    18
      lib/android/app/src/main/java/com/reactnativenavigation/parse/LayoutFactory.java
  3. 2
    2
      lib/android/app/src/main/java/com/reactnativenavigation/parse/LayoutNode.java
  4. 3
    3
      lib/android/app/src/main/java/com/reactnativenavigation/parse/OverlayOptions.java
  5. 7
    7
      lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationEvent.java
  6. 12
    12
      lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java
  7. 20
    0
      lib/android/app/src/main/java/com/reactnativenavigation/react/ReactComponentViewCreator.java
  8. 0
    20
      lib/android/app/src/main/java/com/reactnativenavigation/react/ReactContainerViewCreator.java
  9. 14
    14
      lib/android/app/src/main/java/com/reactnativenavigation/react/ReactView.java
  10. 20
    20
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ComponentViewController.java
  11. 7
    7
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ModalStack.java
  12. 8
    8
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/Navigator.java
  13. 1
    1
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/overlay/CustomOverlay.java
  14. 6
    6
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/overlay/DialogViewController.java
  15. 8
    8
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/toptabs/TopTabController.java
  16. 1
    1
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/toptabs/TopTabsAdapter.java
  17. 3
    3
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/toptabs/TopTabsViewPager.java
  18. 1
    1
      lib/android/app/src/main/java/com/reactnativenavigation/views/Component.java
  19. 7
    7
      lib/android/app/src/main/java/com/reactnativenavigation/views/ComponentLayout.java
  20. 22
    0
      lib/android/app/src/main/java/com/reactnativenavigation/views/ComponentViewCreator.java
  21. 0
    22
      lib/android/app/src/main/java/com/reactnativenavigation/views/ContainerViewCreator.java
  22. 4
    4
      lib/android/app/src/main/java/com/reactnativenavigation/views/CustomDialog.java
  23. 6
    0
      lib/android/app/src/main/java/com/reactnativenavigation/views/ReactComponent.java
  24. 0
    6
      lib/android/app/src/main/java/com/reactnativenavigation/views/ReactContainer.java
  25. 5
    5
      lib/android/app/src/main/java/com/reactnativenavigation/views/TitleBarButton.java
  26. 5
    5
      lib/android/app/src/main/java/com/reactnativenavigation/views/TopBar.java
  27. 5
    5
      lib/android/app/src/main/java/com/reactnativenavigation/views/TopTab.java
  28. 5
    5
      lib/android/app/src/main/java/com/reactnativenavigation/views/TopTabCreator.java
  29. 1
    1
      lib/android/app/src/main/java/com/reactnativenavigation/views/TopTabsLayout.java
  30. 12
    0
      lib/android/app/src/test/java/com/reactnativenavigation/mocks/SimpleComponentViewController.java
  31. 0
    12
      lib/android/app/src/test/java/com/reactnativenavigation/mocks/SimpleContainerViewController.java
  32. 5
    5
      lib/android/app/src/test/java/com/reactnativenavigation/mocks/TestComponentLayout.java
  33. 5
    5
      lib/android/app/src/test/java/com/reactnativenavigation/mocks/TestComponentView.java
  34. 13
    0
      lib/android/app/src/test/java/com/reactnativenavigation/mocks/TestComponentViewCreator.java
  35. 0
    13
      lib/android/app/src/test/java/com/reactnativenavigation/mocks/TestContainerViewCreator.java
  36. 4
    4
      lib/android/app/src/test/java/com/reactnativenavigation/mocks/TopTabLayoutMock.java
  37. 7
    7
      lib/android/app/src/test/java/com/reactnativenavigation/parse/LayoutNodeParserTest.java
  38. 1
    1
      lib/android/app/src/test/java/com/reactnativenavigation/parse/NavigationOptionsTest.java
  39. 17
    17
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/ComponentViewControllerTest.java
  40. 6
    6
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/NavigatorTest.java
  41. 9
    9
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/OptionsApplyingTest.java
  42. 4
    4
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/TopTabControllerTest.java
  43. 12
    12
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/TopTabsViewControllerTest.java

+ 27
- 27
lib/android/app/src/main/java/com/reactnativenavigation/anim/StackAnimator.java ファイルの表示

@@ -113,19 +113,19 @@ public class StackAnimator {
113 113
 		return metrics.heightPixels;
114 114
 	}
115 115
 
116
-	public void animateShowTopBar(final TopBar topBar, final View container) {
117
-		ValueAnimator containerHeightAnim = ValueAnimator.ofInt(container.getMeasuredHeight(), container.getMeasuredHeight() - topBar.getMeasuredHeight());
118
-		containerHeightAnim.setInterpolator(DECELERATE_INTERPOLATOR);
119
-		containerHeightAnim.setDuration(DURATION_TOPBAR);
120
-		containerHeightAnim.addUpdateListener(valueAnimator -> {
116
+	public void animateShowTopBar(final TopBar topBar, final View component) {
117
+		ValueAnimator componentHeightAnim = ValueAnimator.ofInt(component.getMeasuredHeight(), component.getMeasuredHeight() - topBar.getMeasuredHeight());
118
+		componentHeightAnim.setInterpolator(DECELERATE_INTERPOLATOR);
119
+		componentHeightAnim.setDuration(DURATION_TOPBAR);
120
+		componentHeightAnim.addUpdateListener(valueAnimator -> {
121 121
             int val = (Integer) valueAnimator.getAnimatedValue();
122
-			ViewGroup.LayoutParams layoutParams = container.getLayoutParams();
122
+			ViewGroup.LayoutParams layoutParams = component.getLayoutParams();
123 123
             layoutParams.height = val;
124
-            container.setLayoutParams(layoutParams);
124
+            component.setLayoutParams(layoutParams);
125 125
         });
126
-		ObjectAnimator containerTransitionAnim = ObjectAnimator.ofFloat(container, View.TRANSLATION_Y, -1 * topBar.getMeasuredHeight(), 0);
127
-		containerTransitionAnim.setInterpolator(DECELERATE_INTERPOLATOR);
128
-		containerTransitionAnim.setDuration(DURATION_TOPBAR);
126
+		ObjectAnimator componentTransitionAnim = ObjectAnimator.ofFloat(component, View.TRANSLATION_Y, -1 * topBar.getMeasuredHeight(), 0);
127
+		componentTransitionAnim.setInterpolator(DECELERATE_INTERPOLATOR);
128
+		componentTransitionAnim.setDuration(DURATION_TOPBAR);
129 129
 
130 130
 		ObjectAnimator topbarAnim = ObjectAnimator.ofFloat(topBar, View.TRANSLATION_Y, -1 * topBar.getHeight(), 0);
131 131
 		topbarAnim.setInterpolator(DECELERATE_INTERPOLATOR);
@@ -140,9 +140,9 @@ public class StackAnimator {
140 140
 
141 141
 			@Override
142 142
 			public void onAnimationEnd(Animator animation) {
143
-                ViewGroup.LayoutParams layoutParams = container.getLayoutParams();
143
+                ViewGroup.LayoutParams layoutParams = component.getLayoutParams();
144 144
 				layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
145
-				container.setLayoutParams(layoutParams);
145
+				component.setLayoutParams(layoutParams);
146 146
 			}
147 147
 
148 148
 			@Override
@@ -155,23 +155,23 @@ public class StackAnimator {
155 155
 
156 156
 			}
157 157
 		});
158
-		set.playTogether(containerHeightAnim, containerTransitionAnim, topbarAnim);
158
+		set.playTogether(componentHeightAnim, componentTransitionAnim, topbarAnim);
159 159
 		set.start();
160 160
 	}
161 161
 
162
-	public void animateHideTopBar(final TopBar topBar, final View container) {
163
-		ValueAnimator containerHeightAnim = ValueAnimator.ofInt(container.getMeasuredHeight(), container.getMeasuredHeight() + topBar.getMeasuredHeight());
164
-		containerHeightAnim.setInterpolator(ACCELERATE_INTERPOLATOR);
165
-		containerHeightAnim.setDuration(DURATION_TOPBAR);
166
-		containerHeightAnim.addUpdateListener(valueAnimator -> {
162
+	public void animateHideTopBar(final TopBar topBar, final View component) {
163
+		ValueAnimator componentHeightAnim = ValueAnimator.ofInt(component.getMeasuredHeight(), component.getMeasuredHeight() + topBar.getMeasuredHeight());
164
+		componentHeightAnim.setInterpolator(ACCELERATE_INTERPOLATOR);
165
+		componentHeightAnim.setDuration(DURATION_TOPBAR);
166
+		componentHeightAnim.addUpdateListener(valueAnimator -> {
167 167
             int val = (Integer) valueAnimator.getAnimatedValue();
168
-			ViewGroup.LayoutParams layoutParams = container.getLayoutParams();
168
+			ViewGroup.LayoutParams layoutParams = component.getLayoutParams();
169 169
             layoutParams.height = val;
170
-            container.setLayoutParams(layoutParams);
170
+            component.setLayoutParams(layoutParams);
171 171
         });
172
-		ObjectAnimator containerTransitionAnim = ObjectAnimator.ofFloat(container, View.TRANSLATION_Y, 0, -1 * topBar.getMeasuredHeight());
173
-		containerTransitionAnim.setInterpolator(ACCELERATE_INTERPOLATOR);
174
-		containerTransitionAnim.setDuration(DURATION_TOPBAR);
172
+		ObjectAnimator componentTransitionAnim = ObjectAnimator.ofFloat(component, View.TRANSLATION_Y, 0, -1 * topBar.getMeasuredHeight());
173
+		componentTransitionAnim.setInterpolator(ACCELERATE_INTERPOLATOR);
174
+		componentTransitionAnim.setDuration(DURATION_TOPBAR);
175 175
 
176 176
 		ObjectAnimator topbarAnim = ObjectAnimator.ofFloat(topBar, View.TRANSLATION_Y, 0, -1 * topBar.getMeasuredHeight());
177 177
 		topbarAnim.setInterpolator(ACCELERATE_INTERPOLATOR);
@@ -185,10 +185,10 @@ public class StackAnimator {
185 185
 
186 186
 			@Override
187 187
 			public void onAnimationEnd(Animator animation) {
188
-                ViewGroup.LayoutParams layoutParams = container.getLayoutParams();
188
+                ViewGroup.LayoutParams layoutParams = component.getLayoutParams();
189 189
 				layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
190
-				container.setLayoutParams(layoutParams);
191
-				container.setTranslationY(0);
190
+				component.setLayoutParams(layoutParams);
191
+				component.setTranslationY(0);
192 192
 
193 193
 				topBar.setVisibility(View.GONE);
194 194
 				topBar.setTranslationY(0);
@@ -204,7 +204,7 @@ public class StackAnimator {
204 204
 
205 205
 			}
206 206
 		});
207
-		set.playTogether(containerHeightAnim, containerTransitionAnim, topbarAnim);
207
+		set.playTogether(componentHeightAnim, componentTransitionAnim, topbarAnim);
208 208
 		set.start();
209 209
 	}
210 210
 }

+ 18
- 18
lib/android/app/src/main/java/com/reactnativenavigation/parse/LayoutFactory.java ファイルの表示

@@ -3,17 +3,17 @@ package com.reactnativenavigation.parse;
3 3
 import android.app.Activity;
4 4
 
5 5
 import com.facebook.react.ReactInstanceManager;
6
-import com.reactnativenavigation.react.ReactContainerViewCreator;
6
+import com.reactnativenavigation.react.ReactComponentViewCreator;
7 7
 import com.reactnativenavigation.utils.TypefaceLoader;
8 8
 import com.reactnativenavigation.viewcontrollers.BottomTabsController;
9
-import com.reactnativenavigation.viewcontrollers.ContainerViewController;
9
+import com.reactnativenavigation.viewcontrollers.ComponentViewController;
10 10
 import com.reactnativenavigation.viewcontrollers.SideMenuController;
11 11
 import com.reactnativenavigation.viewcontrollers.StackController;
12 12
 import com.reactnativenavigation.viewcontrollers.ViewController;
13 13
 import com.reactnativenavigation.viewcontrollers.overlay.DialogViewController;
14 14
 import com.reactnativenavigation.viewcontrollers.toptabs.TopTabController;
15 15
 import com.reactnativenavigation.viewcontrollers.toptabs.TopTabsController;
16
-import com.reactnativenavigation.views.ContainerViewCreator;
16
+import com.reactnativenavigation.views.ComponentViewCreator;
17 17
 import com.reactnativenavigation.views.TopTabsLayoutCreator;
18 18
 
19 19
 import java.util.ArrayList;
@@ -35,10 +35,10 @@ public class LayoutFactory {
35 35
 
36 36
 	public ViewController create(final LayoutNode node) {
37 37
 		switch (node.type) {
38
-			case Container:
39
-				return createContainer(node);
40
-			case ContainerStack:
41
-				return createContainerStack(node);
38
+			case Component:
39
+				return createComponent(node);
40
+			case ComponentStack:
41
+				return createComponentStack(node);
42 42
 			case BottomTabs:
43 43
 				return createBottomTabs(node);
44 44
 			case SideMenuRoot:
@@ -50,7 +50,7 @@ public class LayoutFactory {
50 50
 			case SideMenuRight:
51 51
 				return createSideMenuRight(node);
52 52
 			case CustomDialog:
53
-				return createDialogContainer(node);
53
+				return createDialogComponent(node);
54 54
             case TopTabs:
55 55
                 return createTopTabs(node);
56 56
             case TopTab:
@@ -93,19 +93,19 @@ public class LayoutFactory {
93 93
 		return create(node.children.get(0));
94 94
 	}
95 95
 
96
-	private ViewController createContainer(LayoutNode node) {
96
+	private ViewController createComponent(LayoutNode node) {
97 97
 		String id = node.id;
98 98
 		String name = node.data.optString("name");
99 99
 		NavigationOptions navigationOptions = NavigationOptions.parse(typefaceManager, node.data.optJSONObject("navigationOptions"), defaultOptions);
100
-		return new ContainerViewController(activity,
100
+		return new ComponentViewController(activity,
101 101
                 id,
102 102
                 name,
103
-                new ContainerViewCreator(reactInstanceManager),
103
+                new ComponentViewCreator(reactInstanceManager),
104 104
                 navigationOptions
105 105
         );
106 106
 	}
107 107
 
108
-	private ViewController createContainerStack(LayoutNode node) {
108
+	private ViewController createComponentStack(LayoutNode node) {
109 109
 		StackController stackController = new StackController(activity, node.id);
110 110
 		for (LayoutNode child : node.children) {
111 111
 			stackController.push(create(child), null);
@@ -114,19 +114,19 @@ public class LayoutFactory {
114 114
 	}
115 115
 
116 116
 	private ViewController createBottomTabs(LayoutNode node) {
117
-		final BottomTabsController tabsContainer = new BottomTabsController(activity, node.id);
117
+		final BottomTabsController tabsComponent = new BottomTabsController(activity, node.id);
118 118
 		List<ViewController> tabs = new ArrayList<>();
119 119
 		for (int i = 0; i < node.children.size(); i++) {
120 120
 			tabs.add(create(node.children.get(i)));
121 121
 		}
122
-		tabsContainer.setTabs(tabs);
123
-		return tabsContainer;
122
+		tabsComponent.setTabs(tabs);
123
+		return tabsComponent;
124 124
 	}
125 125
 
126
-	private ViewController createDialogContainer(LayoutNode node) {
126
+	private ViewController createDialogComponent(LayoutNode node) {
127 127
 		String id = node.id;
128 128
 		String name = node.data.optString("name");
129
-		ReactContainerViewCreator creator = new ReactContainerViewCreator(reactInstanceManager);
129
+		ReactComponentViewCreator creator = new ReactComponentViewCreator(reactInstanceManager);
130 130
 		return new DialogViewController(activity, id, name, creator);
131 131
 	}
132 132
 
@@ -148,7 +148,7 @@ public class LayoutFactory {
148 148
         return new TopTabController(activity,
149 149
                 id,
150 150
                 name,
151
-                new ReactContainerViewCreator(reactInstanceManager),
151
+                new ReactComponentViewCreator(reactInstanceManager),
152 152
                 navigationOptions
153 153
         );
154 154
     }

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/parse/LayoutNode.java ファイルの表示

@@ -7,8 +7,8 @@ import java.util.List;
7 7
 
8 8
 public class LayoutNode {
9 9
 	public enum Type {
10
-		Container,
11
-		ContainerStack,
10
+		Component,
11
+		ComponentStack,
12 12
 		BottomTabs,
13 13
 		SideMenuRoot,
14 14
 		SideMenuCenter,

+ 3
- 3
lib/android/app/src/main/java/com/reactnativenavigation/parse/OverlayOptions.java ファイルの表示

@@ -27,11 +27,11 @@ public class OverlayOptions {
27 27
 		return options;
28 28
 	}
29 29
 
30
-	public static OverlayOptions create(ViewController containerView) {
30
+	public static OverlayOptions create(ViewController componentView) {
31 31
 		OverlayOptions options = new OverlayOptions();
32
-		if (containerView == null) return options;
32
+		if (componentView == null) return options;
33 33
 
34
-		options.customView = containerView;
34
+		options.customView = componentView;
35 35
 		return options;
36 36
 	}
37 37
 

+ 7
- 7
lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationEvent.java ファイルの表示

@@ -13,8 +13,8 @@ import static com.facebook.react.modules.core.DeviceEventManagerModule.RCTDevice
13 13
 
14 14
 public class NavigationEvent {
15 15
 	private static final String onAppLaunched = "RNN.appLaunched";
16
-	private static final String containerDidAppear = "RNN.containerDidAppear";
17
-	private static final String containerDidDisappear = "RNN.containerDidDisappear";
16
+	private static final String componentDidAppear = "RNN.componentDidAppear";
17
+	private static final String componentDidDisappear = "RNN.componentDidDisappear";
18 18
 	private static final String onNavigationButtonPressed = "RNN.navigationButtonPressed";
19 19
 
20 20
 	private final RCTDeviceEventEmitter emitter;
@@ -27,17 +27,17 @@ public class NavigationEvent {
27 27
 		emit(onAppLaunched);
28 28
 	}
29 29
 
30
-	public void containerDidDisappear(String id) {
31
-		emit(containerDidDisappear, id);
30
+	public void componentDidDisappear(String id) {
31
+		emit(componentDidDisappear, id);
32 32
 	}
33 33
 
34
-	public void containerDidAppear(String id) {
35
-		emit(containerDidAppear, id);
34
+	public void componentDidAppear(String id) {
35
+		emit(componentDidAppear, id);
36 36
 	}
37 37
 
38 38
 	public void sendOnNavigationButtonPressed(String id, String buttonId) {
39 39
 		WritableMap map = Arguments.createMap();
40
-		map.putString("containerId", id);
40
+		map.putString("componentId", id);
41 41
 		map.putString("buttonId", buttonId);
42 42
 
43 43
 		emit(onNavigationButtonPressed, map);

+ 12
- 12
lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java ファイルの表示

@@ -52,33 +52,33 @@ public class NavigationModule extends ReactContextBaseJavaModule {
52 52
     }
53 53
 
54 54
 	@ReactMethod
55
-	public void setOptions(final String onContainerId, final ReadableMap options) {
55
+	public void setOptions(final String onComponentId, final ReadableMap options) {
56 56
 		final NavigationOptions navOptions = NavigationOptions.parse(new TypefaceLoader(activity()), JSONParser.parse(options));
57
-		handle(() -> navigator().setOptions(onContainerId, navOptions));
57
+		handle(() -> navigator().setOptions(onComponentId, navOptions));
58 58
 	}
59 59
 
60 60
 	@ReactMethod
61
-	public void push(final String onContainerId, final ReadableMap rawLayoutTree, final Promise promise) {
61
+	public void push(final String onComponentId, final ReadableMap rawLayoutTree, final Promise promise) {
62 62
 		final LayoutNode layoutTree = LayoutNodeParser.parse(JSONParser.parse(rawLayoutTree));
63 63
 		handle(() -> {
64 64
             final ViewController viewController = newLayoutFactory().create(layoutTree);
65
-            navigator().push(onContainerId, viewController, promise);
65
+            navigator().push(onComponentId, viewController, promise);
66 66
         });
67 67
 	}
68 68
 
69 69
 	@ReactMethod
70
-	public void pop(final String onContainerId, final ReadableMap options, final Promise promise) {
71
-		handle(() -> navigator().popSpecific(onContainerId, promise));
70
+	public void pop(final String onComponentId, final ReadableMap options, final Promise promise) {
71
+		handle(() -> navigator().popSpecific(onComponentId, promise));
72 72
 	}
73 73
 
74 74
 	@ReactMethod
75
-	public void popTo(final String containerId, final Promise promise) {
76
-		handle(() -> navigator().popTo(containerId, promise));
75
+	public void popTo(final String componentId, final Promise promise) {
76
+		handle(() -> navigator().popTo(componentId, promise));
77 77
 	}
78 78
 
79 79
 	@ReactMethod
80
-	public void popToRoot(final String containerId, final Promise promise) {
81
-		handle(() -> navigator().popToRoot(containerId, promise));
80
+	public void popToRoot(final String componentId, final Promise promise) {
81
+		handle(() -> navigator().popToRoot(componentId, promise));
82 82
 	}
83 83
 
84 84
 	@ReactMethod
@@ -91,8 +91,8 @@ public class NavigationModule extends ReactContextBaseJavaModule {
91 91
 	}
92 92
 
93 93
 	@ReactMethod
94
-	public void dismissModal(final String containerId, final Promise promise) {
95
-		handle(() -> navigator().dismissModal(containerId, promise));
94
+	public void dismissModal(final String componentId, final Promise promise) {
95
+		handle(() -> navigator().dismissModal(componentId, promise));
96 96
 	}
97 97
 
98 98
 	@ReactMethod

+ 20
- 0
lib/android/app/src/main/java/com/reactnativenavigation/react/ReactComponentViewCreator.java ファイルの表示

@@ -0,0 +1,20 @@
1
+package com.reactnativenavigation.react;
2
+
3
+import android.app.Activity;
4
+
5
+import com.facebook.react.ReactInstanceManager;
6
+import com.reactnativenavigation.viewcontrollers.ComponentViewController;
7
+import com.reactnativenavigation.viewcontrollers.ComponentViewController.ReactViewCreator;
8
+
9
+public class ReactComponentViewCreator implements ReactViewCreator {
10
+	private ReactInstanceManager reactInstanceManager;
11
+
12
+	public ReactComponentViewCreator(final ReactInstanceManager reactInstanceManager) {
13
+		this.reactInstanceManager = reactInstanceManager;
14
+	}
15
+
16
+	@Override
17
+	public ComponentViewController.IReactView create(final Activity activity, final String componentId, final String componentName) {
18
+		return new ReactView(activity, reactInstanceManager, componentId, componentName);
19
+	}
20
+}

+ 0
- 20
lib/android/app/src/main/java/com/reactnativenavigation/react/ReactContainerViewCreator.java ファイルの表示

@@ -1,20 +0,0 @@
1
-package com.reactnativenavigation.react;
2
-
3
-import android.app.Activity;
4
-
5
-import com.facebook.react.ReactInstanceManager;
6
-import com.reactnativenavigation.viewcontrollers.ContainerViewController;
7
-import com.reactnativenavigation.viewcontrollers.ContainerViewController.ReactViewCreator;
8
-
9
-public class ReactContainerViewCreator implements ReactViewCreator {
10
-	private ReactInstanceManager reactInstanceManager;
11
-
12
-	public ReactContainerViewCreator(final ReactInstanceManager reactInstanceManager) {
13
-		this.reactInstanceManager = reactInstanceManager;
14
-	}
15
-
16
-	@Override
17
-	public ContainerViewController.IReactView create(final Activity activity, final String containerId, final String containerName) {
18
-		return new ReactView(activity, reactInstanceManager, containerId, containerName);
19
-	}
20
-}

+ 14
- 14
lib/android/app/src/main/java/com/reactnativenavigation/react/ReactView.java ファイルの表示

@@ -7,21 +7,21 @@ import android.view.View;
7 7
 
8 8
 import com.facebook.react.ReactInstanceManager;
9 9
 import com.facebook.react.ReactRootView;
10
-import com.reactnativenavigation.viewcontrollers.ContainerViewController;
10
+import com.reactnativenavigation.viewcontrollers.ComponentViewController;
11 11
 
12 12
 @SuppressLint("ViewConstructor")
13
-public class ReactView extends ReactRootView implements ContainerViewController.IReactView {
13
+public class ReactView extends ReactRootView implements ComponentViewController.IReactView {
14 14
 
15 15
 	private final ReactInstanceManager reactInstanceManager;
16
-	private final String containerId;
17
-	private final String containerName;
16
+	private final String componentId;
17
+	private final String componentName;
18 18
 	private boolean isAttachedToReactInstance = false;
19 19
 
20
-	public ReactView(final Context context, ReactInstanceManager reactInstanceManager, String containerId, String containerName) {
20
+	public ReactView(final Context context, ReactInstanceManager reactInstanceManager, String componentId, String componentName) {
21 21
 		super(context);
22 22
 		this.reactInstanceManager = reactInstanceManager;
23
-		this.containerId = containerId;
24
-		this.containerName = containerName;
23
+		this.componentId = componentId;
24
+		this.componentName = componentName;
25 25
 		start();
26 26
 	}
27 27
 
@@ -31,8 +31,8 @@ public class ReactView extends ReactRootView implements ContainerViewController.
31 31
             isAttachedToReactInstance = true;
32 32
         });
33 33
 		final Bundle opts = new Bundle();
34
-		opts.putString("containerId", containerId);
35
-		startReactApplication(reactInstanceManager, containerName, opts);
34
+		opts.putString("componentId", componentId);
35
+		startReactApplication(reactInstanceManager, componentName, opts);
36 36
 	}
37 37
 
38 38
 	@Override
@@ -51,17 +51,17 @@ public class ReactView extends ReactRootView implements ContainerViewController.
51 51
 	}
52 52
 
53 53
 	@Override
54
-	public void sendContainerStart() {
55
-		new NavigationEvent(reactInstanceManager.getCurrentReactContext()).containerDidAppear(containerId);
54
+	public void sendComponentStart() {
55
+		new NavigationEvent(reactInstanceManager.getCurrentReactContext()).componentDidAppear(componentId);
56 56
 	}
57 57
 
58 58
 	@Override
59
-	public void sendContainerStop() {
60
-		new NavigationEvent(reactInstanceManager.getCurrentReactContext()).containerDidDisappear(containerId);
59
+	public void sendComponentStop() {
60
+		new NavigationEvent(reactInstanceManager.getCurrentReactContext()).componentDidDisappear(componentId);
61 61
 	}
62 62
 
63 63
     @Override
64 64
 	public void sendOnNavigationButtonPressed(String buttonId) {
65
-		new NavigationEvent(reactInstanceManager.getCurrentReactContext()).sendOnNavigationButtonPressed(containerId, buttonId);
65
+		new NavigationEvent(reactInstanceManager.getCurrentReactContext()).sendOnNavigationButtonPressed(componentId, buttonId);
66 66
 	}
67 67
 }

lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ContainerViewController.java → lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ComponentViewController.java ファイルの表示

@@ -7,14 +7,14 @@ import android.view.View;
7 7
 
8 8
 import com.reactnativenavigation.parse.NavigationOptions;
9 9
 import com.reactnativenavigation.presentation.NavigationOptionsListener;
10
-import com.reactnativenavigation.views.ReactContainer;
10
+import com.reactnativenavigation.views.ReactComponent;
11 11
 import com.reactnativenavigation.views.TopBar;
12 12
 
13
-public class ContainerViewController extends ViewController implements NavigationOptionsListener {
13
+public class ComponentViewController extends ViewController implements NavigationOptionsListener {
14 14
 
15 15
     public interface ReactViewCreator {
16 16
 
17
-        IReactView create(Activity activity, String containerId, String containerName);
17
+        IReactView create(Activity activity, String componentId, String componentName);
18 18
 	}
19 19
 
20 20
 	public interface IReactView {
@@ -25,72 +25,72 @@ public class ContainerViewController extends ViewController implements Navigatio
25 25
 
26 26
 		void destroy();
27 27
 
28
-		void sendContainerStart();
28
+		void sendComponentStart();
29 29
 
30
-		void sendContainerStop();
30
+		void sendComponentStop();
31 31
 
32 32
         void sendOnNavigationButtonPressed(String buttonId);
33 33
     }
34 34
 
35
-	private final String containerName;
35
+	private final String componentName;
36 36
 
37 37
 	private final ReactViewCreator viewCreator;
38 38
 	private NavigationOptions navigationOptions;
39
-	private ReactContainer container;
39
+	private ReactComponent component;
40 40
 
41
-	public ContainerViewController(final Activity activity,
41
+	public ComponentViewController(final Activity activity,
42 42
 								   final String id,
43
-								   final String containerName,
43
+								   final String componentName,
44 44
 								   final ReactViewCreator viewCreator,
45 45
 								   final NavigationOptions initialNavigationOptions) {
46 46
 		super(activity, id);
47
-		this.containerName = containerName;
47
+		this.componentName = componentName;
48 48
 		this.viewCreator = viewCreator;
49 49
 		this.navigationOptions = initialNavigationOptions;
50 50
 	}
51 51
 
52 52
     @RestrictTo(RestrictTo.Scope.TESTS)
53 53
     TopBar getTopBar() {
54
-        return container.getTopBar();
54
+        return component.getTopBar();
55 55
     }
56 56
 
57 57
 	@Override
58 58
 	public void destroy() {
59 59
 		super.destroy();
60
-		if (container != null) container.destroy();
61
-		container = null;
60
+		if (component != null) component.destroy();
61
+		component = null;
62 62
 	}
63 63
 
64 64
 	@Override
65 65
 	public void onViewAppeared() {
66 66
 		super.onViewAppeared();
67 67
 		ensureViewIsCreated();
68
-		container.applyOptions(navigationOptions);
69
-		container.sendContainerStart();
68
+		component.applyOptions(navigationOptions);
69
+		component.sendComponentStart();
70 70
 	}
71 71
 
72 72
 	@Override
73 73
 	public void onViewDisappear() {
74 74
 		super.onViewDisappear();
75
-		container.sendContainerStop();
75
+		component.sendComponentStop();
76 76
 	}
77 77
 
78 78
 	@Override
79 79
 	protected boolean isViewShown() {
80
-		return super.isViewShown() && container.isReady();
80
+		return super.isViewShown() && component.isReady();
81 81
 	}
82 82
 
83 83
 	@NonNull
84 84
 	@Override
85 85
 	protected View createView() {
86
-		container = (ReactContainer) viewCreator.create(getActivity(), getId(), containerName);
87
-        return container.asView();
86
+		component = (ReactComponent) viewCreator.create(getActivity(), getId(), componentName);
87
+        return component.asView();
88 88
 	}
89 89
 
90 90
 	@Override
91 91
 	public void mergeNavigationOptions(NavigationOptions options) {
92 92
 		navigationOptions.mergeWith(options);
93
-        container.applyOptions(navigationOptions);
93
+        component.applyOptions(navigationOptions);
94 94
 	}
95 95
 
96 96
 	NavigationOptions getNavigationOptions() {

+ 7
- 7
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ModalStack.java ファイルの表示

@@ -26,13 +26,13 @@ public class ModalStack {
26 26
 		}
27 27
 	}
28 28
 
29
-	public void dismissModal(final String containerId, Promise promise) {
30
-		Modal modal = findModalByContainerId(containerId);
29
+	public void dismissModal(final String componentId, Promise promise) {
30
+		Modal modal = findModalByComponentId(componentId);
31 31
 		if (modal != null) {
32 32
 			modal.dismiss();
33 33
 			modals.remove(modal);
34 34
 			if (promise != null) {
35
-				promise.resolve(containerId);
35
+				promise.resolve(componentId);
36 36
 			}
37 37
 		} else {
38 38
 			Navigator.rejectPromise(promise);
@@ -50,9 +50,9 @@ public class ModalStack {
50 50
 	}
51 51
 
52 52
 	@Nullable
53
-	private Modal findModalByContainerId(String containerId) {
53
+	private Modal findModalByComponentId(String componentId) {
54 54
 		for (Modal modal : modals) {
55
-			if (modal.containsDeepContainerId(containerId)) {
55
+			if (modal.containsDeepComponentId(componentId)) {
56 56
 				return modal;
57 57
 			}
58 58
 		}
@@ -78,8 +78,8 @@ public class ModalStack {
78 78
 			dialog.dismiss();
79 79
 		}
80 80
 
81
-		boolean containsDeepContainerId(String containerId) {
82
-			return viewController.findControllerById(containerId) != null;
81
+		boolean containsDeepComponentId(String componentId) {
82
+			return viewController.findControllerById(componentId) != null;
83 83
 		}
84 84
 
85 85
 		private void preMeasureView() {

+ 8
- 8
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/Navigator.java ファイルの表示

@@ -77,8 +77,8 @@ public class Navigator extends ParentController {
77 77
         return defaultOptions;
78 78
     }
79 79
 
80
-	public void setOptions(final String containerId, NavigationOptions options) {
81
-		ViewController target = findControllerById(containerId);
80
+	public void setOptions(final String componentId, NavigationOptions options) {
81
+		ViewController target = findControllerById(componentId);
82 82
 		if (target instanceof NavigationOptionsListener) {
83 83
 			((NavigationOptionsListener) target).mergeNavigationOptions(options);
84 84
 		}
@@ -133,12 +133,12 @@ public class Navigator extends ParentController {
133 133
 		}
134 134
 	}
135 135
 
136
-	void popTo(final String containerId) {
137
-		popTo(containerId, null);
136
+	void popTo(final String componentId) {
137
+		popTo(componentId, null);
138 138
 	}
139 139
 
140
-	public void popTo(final String containerId, Promise promise) {
141
-		ViewController target = findControllerById(containerId);
140
+	public void popTo(final String componentId, Promise promise) {
141
+		ViewController target = findControllerById(componentId);
142 142
 		if (target != null) {
143 143
 		    target.performOnParentStack(stack -> stack.popTo(target, promise), () -> rejectPromise(promise));
144 144
 		} else {
@@ -150,8 +150,8 @@ public class Navigator extends ParentController {
150 150
 		modalStack.showModal(viewController, promise);
151 151
 	}
152 152
 
153
-	public void dismissModal(final String containerId, Promise promise) {
154
-		modalStack.dismissModal(containerId, promise);
153
+	public void dismissModal(final String componentId, Promise promise) {
154
+		modalStack.dismissModal(componentId, promise);
155 155
 	}
156 156
 
157 157
 	public void dismissAllModals(Promise promise) {

+ 1
- 1
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/overlay/CustomOverlay.java ファイルの表示

@@ -4,7 +4,7 @@ package com.reactnativenavigation.viewcontrollers.overlay;
4 4
 import android.content.Context;
5 5
 
6 6
 import com.reactnativenavigation.parse.OverlayOptions;
7
-import com.reactnativenavigation.viewcontrollers.ContainerViewController;
7
+import com.reactnativenavigation.viewcontrollers.ComponentViewController;
8 8
 import com.reactnativenavigation.viewcontrollers.ViewController;
9 9
 import com.reactnativenavigation.views.CustomDialog;
10 10
 

+ 6
- 6
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/overlay/DialogViewController.java ファイルの表示

@@ -4,24 +4,24 @@ import android.app.Activity;
4 4
 import android.support.annotation.NonNull;
5 5
 import android.view.View;
6 6
 
7
-import com.reactnativenavigation.viewcontrollers.ContainerViewController;
7
+import com.reactnativenavigation.viewcontrollers.ComponentViewController;
8 8
 import com.reactnativenavigation.viewcontrollers.ViewController;
9 9
 
10 10
 
11 11
 public class DialogViewController extends ViewController {
12 12
 
13
-	private ContainerViewController.ReactViewCreator viewCreator;
14
-	private String containerName;
13
+	private ComponentViewController.ReactViewCreator viewCreator;
14
+	private String componentName;
15 15
 
16
-	public DialogViewController(Activity activity, String id, String containerName, ContainerViewController.ReactViewCreator viewCreator) {
16
+	public DialogViewController(Activity activity, String id, String componentName, ComponentViewController.ReactViewCreator viewCreator) {
17 17
 		super(activity, id);
18 18
 		this.viewCreator = viewCreator;
19
-		this.containerName = containerName;
19
+		this.componentName = componentName;
20 20
 	}
21 21
 
22 22
 	@NonNull
23 23
 	@Override
24 24
 	protected View createView() {
25
-		return viewCreator.create(getActivity(), getId(), containerName).asView();
25
+		return viewCreator.create(getActivity(), getId(), componentName).asView();
26 26
 	}
27 27
 }

+ 8
- 8
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/toptabs/TopTabController.java ファイルの表示

@@ -5,21 +5,21 @@ import android.view.View;
5 5
 
6 6
 import com.reactnativenavigation.parse.NavigationOptions;
7 7
 import com.reactnativenavigation.presentation.NavigationOptionsListener;
8
-import com.reactnativenavigation.viewcontrollers.ContainerViewController;
8
+import com.reactnativenavigation.viewcontrollers.ComponentViewController;
9 9
 import com.reactnativenavigation.viewcontrollers.ViewController;
10 10
 import com.reactnativenavigation.views.TopTab;
11 11
 
12 12
 public class TopTabController extends ViewController implements NavigationOptionsListener {
13 13
 
14
-    private final String containerName;
15
-    private ContainerViewController.ReactViewCreator viewCreator;
14
+    private final String componentName;
15
+    private ComponentViewController.ReactViewCreator viewCreator;
16 16
     private final NavigationOptions options;
17 17
     private TopTab topTab;
18 18
     private boolean isSelectedTab;
19 19
 
20
-    public TopTabController(Activity activity, String id, String name, ContainerViewController.ReactViewCreator viewCreator, NavigationOptions initialOptions) {
20
+    public TopTabController(Activity activity, String id, String name, ComponentViewController.ReactViewCreator viewCreator, NavigationOptions initialOptions) {
21 21
         super(activity, id);
22
-        this.containerName = name;
22
+        this.componentName = name;
23 23
         this.viewCreator = viewCreator;
24 24
         this.options = initialOptions;
25 25
     }
@@ -29,7 +29,7 @@ public class TopTabController extends ViewController implements NavigationOption
29 29
         super.onViewAppeared();
30 30
         isSelectedTab = true;
31 31
         applyOptions(options);
32
-        topTab.sendContainerStart();
32
+        topTab.sendComponentStart();
33 33
     }
34 34
 
35 35
     @Override
@@ -41,7 +41,7 @@ public class TopTabController extends ViewController implements NavigationOption
41 41
     public void onViewDisappear() {
42 42
         super.onViewDisappear();
43 43
         isSelectedTab = false;
44
-        topTab.sendContainerStop();
44
+        topTab.sendComponentStop();
45 45
     }
46 46
 
47 47
     @Override
@@ -53,7 +53,7 @@ public class TopTabController extends ViewController implements NavigationOption
53 53
     public View createView() {
54 54
         topTab = new TopTab(
55 55
                 getActivity(),
56
-                viewCreator.create(getActivity(), getId(), containerName)
56
+                viewCreator.create(getActivity(), getId(), componentName)
57 57
         );
58 58
         return topTab;
59 59
     }

+ 1
- 1
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/toptabs/TopTabsAdapter.java ファイルの表示

@@ -31,7 +31,7 @@ public class TopTabsAdapter extends PagerAdapter implements ViewPager.OnPageChan
31 31
     }
32 32
 
33 33
     @Override
34
-    public Object instantiateItem(ViewGroup container, int position) {
34
+    public Object instantiateItem(ViewGroup component, int position) {
35 35
         return tabs.get(position).getView();
36 36
     }
37 37
 

+ 3
- 3
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/toptabs/TopTabsViewPager.java ファイルの表示

@@ -5,7 +5,7 @@ import android.content.Context;
5 5
 import android.support.v4.view.ViewPager;
6 6
 import android.view.ViewGroup;
7 7
 
8
-import com.reactnativenavigation.viewcontrollers.ContainerViewController;
8
+import com.reactnativenavigation.viewcontrollers.ComponentViewController;
9 9
 import com.reactnativenavigation.viewcontrollers.ViewController;
10 10
 
11 11
 import java.util.List;
@@ -39,6 +39,6 @@ public class TopTabsViewPager extends ViewPager {
39 39
     }
40 40
 
41 41
     public void sendOnNavigationButtonPressed(String id) {
42
-        ((ContainerViewController.IReactView) tabs.get(getCurrentItem()).getView()).sendOnNavigationButtonPressed(id);
42
+        ((ComponentViewController.IReactView) tabs.get(getCurrentItem()).getView()).sendOnNavigationButtonPressed(id);
43 43
     }
44
-}
44
+}

lib/android/app/src/main/java/com/reactnativenavigation/views/Container.java → lib/android/app/src/main/java/com/reactnativenavigation/views/Component.java ファイルの表示

@@ -4,7 +4,7 @@ import android.support.annotation.RestrictTo;
4 4
 
5 5
 import com.reactnativenavigation.parse.NavigationOptions;
6 6
 
7
-public interface Container {
7
+public interface Component {
8 8
     void applyOptions(NavigationOptions options);
9 9
 
10 10
     void sendOnNavigationButtonPressed(String id);

lib/android/app/src/main/java/com/reactnativenavigation/views/ContainerLayout.java → lib/android/app/src/main/java/com/reactnativenavigation/views/ComponentLayout.java ファイルの表示

@@ -8,16 +8,16 @@ import android.widget.LinearLayout;
8 8
 
9 9
 import com.reactnativenavigation.parse.NavigationOptions;
10 10
 import com.reactnativenavigation.presentation.OptionsPresenter;
11
-import com.reactnativenavigation.viewcontrollers.ContainerViewController.IReactView;
11
+import com.reactnativenavigation.viewcontrollers.ComponentViewController.IReactView;
12 12
 
13 13
 @SuppressLint("ViewConstructor")
14
-public class ContainerLayout extends LinearLayout implements ReactContainer {
14
+public class ComponentLayout extends LinearLayout implements ReactComponent {
15 15
 
16 16
 	private TopBar topBar;
17 17
 	private IReactView reactView;
18 18
 	private final OptionsPresenter optionsPresenter;
19 19
 
20
-	public ContainerLayout(Context context, IReactView reactView) {
20
+	public ComponentLayout(Context context, IReactView reactView) {
21 21
 		super(context);
22 22
 		this.topBar = new TopBar(context, this);
23 23
 		this.reactView = reactView;
@@ -47,13 +47,13 @@ public class ContainerLayout extends LinearLayout implements ReactContainer {
47 47
 	}
48 48
 
49 49
 	@Override
50
-	public void sendContainerStart() {
51
-		reactView.sendContainerStart();
50
+	public void sendComponentStart() {
51
+		reactView.sendComponentStart();
52 52
 	}
53 53
 
54 54
 	@Override
55
-	public void sendContainerStop() {
56
-		reactView.sendContainerStop();
55
+	public void sendComponentStop() {
56
+		reactView.sendComponentStop();
57 57
 	}
58 58
 
59 59
     @Override

+ 22
- 0
lib/android/app/src/main/java/com/reactnativenavigation/views/ComponentViewCreator.java ファイルの表示

@@ -0,0 +1,22 @@
1
+package com.reactnativenavigation.views;
2
+
3
+import android.app.Activity;
4
+
5
+import com.facebook.react.ReactInstanceManager;
6
+import com.reactnativenavigation.react.ReactComponentViewCreator;
7
+import com.reactnativenavigation.viewcontrollers.ComponentViewController;
8
+
9
+public class ComponentViewCreator implements ComponentViewController.ReactViewCreator {
10
+
11
+    private ReactInstanceManager instanceManager;
12
+
13
+    public ComponentViewCreator(ReactInstanceManager instanceManager) {
14
+        this.instanceManager = instanceManager;
15
+	}
16
+
17
+	@Override
18
+	public ComponentViewController.IReactView create(Activity activity, String componentId, String componentName) {
19
+        ComponentViewController.IReactView reactView = new ReactComponentViewCreator(instanceManager).create(activity, componentId, componentName);
20
+        return new ComponentLayout(activity, reactView);
21
+	}
22
+}

+ 0
- 22
lib/android/app/src/main/java/com/reactnativenavigation/views/ContainerViewCreator.java ファイルの表示

@@ -1,22 +0,0 @@
1
-package com.reactnativenavigation.views;
2
-
3
-import android.app.Activity;
4
-
5
-import com.facebook.react.ReactInstanceManager;
6
-import com.reactnativenavigation.react.ReactContainerViewCreator;
7
-import com.reactnativenavigation.viewcontrollers.ContainerViewController;
8
-
9
-public class ContainerViewCreator implements ContainerViewController.ReactViewCreator {
10
-
11
-    private ReactInstanceManager instanceManager;
12
-
13
-    public ContainerViewCreator(ReactInstanceManager instanceManager) {
14
-        this.instanceManager = instanceManager;
15
-	}
16
-
17
-	@Override
18
-	public ContainerViewController.IReactView create(Activity activity, String containerId, String containerName) {
19
-        ContainerViewController.IReactView reactView = new ReactContainerViewCreator(instanceManager).create(activity, containerId, containerName);
20
-        return new ContainerLayout(activity, reactView);
21
-	}
22
-}

+ 4
- 4
lib/android/app/src/main/java/com/reactnativenavigation/views/CustomDialog.java ファイルの表示

@@ -14,16 +14,16 @@ import com.facebook.react.ReactRootView;
14 14
 
15 15
 public class CustomDialog extends Dialog {
16 16
 
17
-	private View container;
17
+	private View component;
18 18
 
19
-	public CustomDialog(@NonNull Context context, @NonNull View container) {
19
+	public CustomDialog(@NonNull Context context, @NonNull View component) {
20 20
 		super(context);
21 21
 
22
-		this.container = container;
22
+		this.component = component;
23 23
 		init();
24 24
 	}
25 25
 
26 26
 	private void init() {
27
-		addContentView(container, new WindowManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
27
+		addContentView(component, new WindowManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
28 28
 	}
29 29
 }

+ 6
- 0
lib/android/app/src/main/java/com/reactnativenavigation/views/ReactComponent.java ファイルの表示

@@ -0,0 +1,6 @@
1
+package com.reactnativenavigation.views;
2
+
3
+import com.reactnativenavigation.viewcontrollers.ComponentViewController;
4
+
5
+public interface ReactComponent extends Component, ComponentViewController.IReactView {
6
+}

+ 0
- 6
lib/android/app/src/main/java/com/reactnativenavigation/views/ReactContainer.java ファイルの表示

@@ -1,6 +0,0 @@
1
-package com.reactnativenavigation.views;
2
-
3
-import com.reactnativenavigation.viewcontrollers.ContainerViewController;
4
-
5
-public interface ReactContainer extends Container, ContainerViewController.IReactView {
6
-}

+ 5
- 5
lib/android/app/src/main/java/com/reactnativenavigation/views/TitleBarButton.java ファイルの表示

@@ -24,11 +24,11 @@ import java.util.ArrayList;
24 24
 public class TitleBarButton implements MenuItem.OnMenuItemClickListener {
25 25
 	private Toolbar toolbar;
26 26
 	private final Button button;
27
-	private Container container;
27
+	private Component component;
28 28
 	private Drawable icon;
29 29
 
30
-	TitleBarButton(Container container, Toolbar toolbar, Button button) {
31
-		this.container = container;
30
+	TitleBarButton(Component component, Toolbar toolbar, Button button) {
31
+		this.component = component;
32 32
 		this.toolbar = toolbar;
33 33
 		this.button = button;
34 34
 	}
@@ -118,12 +118,12 @@ public class TitleBarButton implements MenuItem.OnMenuItemClickListener {
118 118
 	}
119 119
 
120 120
 	private void setNavigationClickListener() {
121
-		toolbar.setNavigationOnClickListener(view -> container.sendOnNavigationButtonPressed(button.id));
121
+		toolbar.setNavigationOnClickListener(view -> component.sendOnNavigationButtonPressed(button.id));
122 122
 	}
123 123
 
124 124
 	@Override
125 125
 	public boolean onMenuItemClick(MenuItem menuItem) {
126
-		this.container.sendOnNavigationButtonPressed(button.id);
126
+		this.component.sendOnNavigationButtonPressed(button.id);
127 127
 		return true;
128 128
 	}
129 129
 

+ 5
- 5
lib/android/app/src/main/java/com/reactnativenavigation/views/TopBar.java ファイルの表示

@@ -23,12 +23,12 @@ import java.util.ArrayList;
23 23
 @SuppressLint("ViewConstructor")
24 24
 public class TopBar extends AppBarLayout {
25 25
 	private final Toolbar titleBar;
26
-    private Container container;
26
+    private Component component;
27 27
     private TopTabs topTabs;
28 28
 
29
-    public TopBar(final Context context, Container container) {
29
+    public TopBar(final Context context, Component component) {
30 30
         super(context);
31
-        this.container = container;
31
+        this.component = component;
32 32
         titleBar = new Toolbar(context);
33 33
         topTabs = new TopTabs(getContext());
34 34
         addView(titleBar);
@@ -115,7 +115,7 @@ public class TopBar extends AppBarLayout {
115 115
 	}
116 116
 
117 117
 	private void setLeftButton(final Button button) {
118
-		TitleBarButton leftBarButton = new TitleBarButton(container, this.titleBar, button);
118
+		TitleBarButton leftBarButton = new TitleBarButton(component, this.titleBar, button);
119 119
 		leftBarButton.applyNavigationIcon(getContext());
120 120
 	}
121 121
 
@@ -129,7 +129,7 @@ public class TopBar extends AppBarLayout {
129 129
 
130 130
 		for (int i = 0; i < rightButtons.size(); i++){
131 131
 	   		Button button = rightButtons.get(i);
132
-			TitleBarButton titleBarButton = new TitleBarButton(container, this.titleBar, button);
132
+			TitleBarButton titleBarButton = new TitleBarButton(component, this.titleBar, button);
133 133
 			titleBarButton.addToMenu(getContext(), menu);
134 134
        }
135 135
     }

+ 5
- 5
lib/android/app/src/main/java/com/reactnativenavigation/views/TopTab.java ファイルの表示

@@ -5,7 +5,7 @@ import android.content.Context;
5 5
 import android.view.View;
6 6
 import android.widget.FrameLayout;
7 7
 
8
-import com.reactnativenavigation.viewcontrollers.ContainerViewController.IReactView;
8
+import com.reactnativenavigation.viewcontrollers.ComponentViewController.IReactView;
9 9
 
10 10
 @SuppressLint("ViewConstructor")
11 11
 public class TopTab extends FrameLayout implements IReactView {
@@ -34,13 +34,13 @@ public class TopTab extends FrameLayout implements IReactView {
34 34
 	}
35 35
 
36 36
 	@Override
37
-	public void sendContainerStart() {
38
-		reactView.sendContainerStart();
37
+	public void sendComponentStart() {
38
+		reactView.sendComponentStart();
39 39
 	}
40 40
 
41 41
 	@Override
42
-	public void sendContainerStop() {
43
-		reactView.sendContainerStop();
42
+	public void sendComponentStop() {
43
+		reactView.sendComponentStop();
44 44
 	}
45 45
 
46 46
     @Override

+ 5
- 5
lib/android/app/src/main/java/com/reactnativenavigation/views/TopTabCreator.java ファイルの表示

@@ -3,10 +3,10 @@ package com.reactnativenavigation.views;
3 3
 import android.app.Activity;
4 4
 
5 5
 import com.facebook.react.ReactInstanceManager;
6
-import com.reactnativenavigation.react.ReactContainerViewCreator;
7
-import com.reactnativenavigation.viewcontrollers.ContainerViewController;
6
+import com.reactnativenavigation.react.ReactComponentViewCreator;
7
+import com.reactnativenavigation.viewcontrollers.ComponentViewController;
8 8
 
9
-public class TopTabCreator implements ContainerViewController.ReactViewCreator {
9
+public class TopTabCreator implements ComponentViewController.ReactViewCreator {
10 10
 
11 11
 
12 12
     private ReactInstanceManager instanceManager;
@@ -16,8 +16,8 @@ public class TopTabCreator implements ContainerViewController.ReactViewCreator {
16 16
     }
17 17
 
18 18
 	@Override
19
-	public ContainerViewController.IReactView create(Activity activity, String containerId, String containerName) {
20
-        ContainerViewController.IReactView reactView = new ReactContainerViewCreator(instanceManager).create(activity, containerId, containerName);
19
+	public ComponentViewController.IReactView create(Activity activity, String componentId, String componentName) {
20
+        ComponentViewController.IReactView reactView = new ReactComponentViewCreator(instanceManager).create(activity, componentId, componentName);
21 21
         return new TopTab(activity, reactView);
22 22
 	}
23 23
 }

+ 1
- 1
lib/android/app/src/main/java/com/reactnativenavigation/views/TopTabsLayout.java ファイルの表示

@@ -15,7 +15,7 @@ import com.reactnativenavigation.viewcontrollers.toptabs.TopTabsViewPager;
15 15
 import java.util.List;
16 16
 
17 17
 @SuppressLint("ViewConstructor")
18
-public class TopTabsLayout extends LinearLayout implements Container {
18
+public class TopTabsLayout extends LinearLayout implements Component {
19 19
 
20 20
     private TopBar topBar;
21 21
     private TopTabsViewPager viewPager;

+ 12
- 0
lib/android/app/src/test/java/com/reactnativenavigation/mocks/SimpleComponentViewController.java ファイルの表示

@@ -0,0 +1,12 @@
1
+package com.reactnativenavigation.mocks;
2
+
3
+import android.app.Activity;
4
+
5
+import com.reactnativenavigation.parse.NavigationOptions;
6
+import com.reactnativenavigation.viewcontrollers.ComponentViewController;
7
+
8
+public class SimpleComponentViewController extends ComponentViewController {
9
+	public SimpleComponentViewController(final Activity activity, final String id) {
10
+		super(activity, id, "theComponentName", new TestComponentViewCreator(), new NavigationOptions());
11
+	}
12
+}

+ 0
- 12
lib/android/app/src/test/java/com/reactnativenavigation/mocks/SimpleContainerViewController.java ファイルの表示

@@ -1,12 +0,0 @@
1
-package com.reactnativenavigation.mocks;
2
-
3
-import android.app.Activity;
4
-
5
-import com.reactnativenavigation.parse.NavigationOptions;
6
-import com.reactnativenavigation.viewcontrollers.ContainerViewController;
7
-
8
-public class SimpleContainerViewController extends ContainerViewController {
9
-	public SimpleContainerViewController(final Activity activity, final String id) {
10
-		super(activity, id, "theContainerName", new TestContainerViewCreator(), new NavigationOptions());
11
-	}
12
-}

lib/android/app/src/test/java/com/reactnativenavigation/mocks/TestContainerLayout.java → lib/android/app/src/test/java/com/reactnativenavigation/mocks/TestComponentLayout.java ファイルの表示

@@ -5,15 +5,15 @@ import android.view.View;
5 5
 
6 6
 import com.reactnativenavigation.parse.NavigationOptions;
7 7
 import com.reactnativenavigation.presentation.OptionsPresenter;
8
-import com.reactnativenavigation.views.ReactContainer;
8
+import com.reactnativenavigation.views.ReactComponent;
9 9
 import com.reactnativenavigation.views.TopBar;
10 10
 
11
-public class TestContainerLayout extends View implements ReactContainer {
11
+public class TestComponentLayout extends View implements ReactComponent {
12 12
 
13 13
     private final TopBar topBar;
14 14
     private final OptionsPresenter optionsPresenter;
15 15
 
16
-    public TestContainerLayout(final Context context) {
16
+    public TestComponentLayout(final Context context) {
17 17
 		super(context);
18 18
         topBar = new TopBar(context, this);
19 19
         optionsPresenter = new OptionsPresenter(topBar, new View(context));
@@ -38,11 +38,11 @@ public class TestContainerLayout extends View implements ReactContainer {
38 38
 	}
39 39
 
40 40
 	@Override
41
-	public void sendContainerStart() {
41
+	public void sendComponentStart() {
42 42
 	}
43 43
 
44 44
 	@Override
45
-	public void sendContainerStop() {
45
+	public void sendComponentStop() {
46 46
 	}
47 47
 
48 48
     @Override

lib/android/app/src/test/java/com/reactnativenavigation/mocks/TestContainerView.java → lib/android/app/src/test/java/com/reactnativenavigation/mocks/TestComponentView.java ファイルの表示

@@ -4,14 +4,14 @@ import android.content.Context;
4 4
 import android.view.View;
5 5
 
6 6
 import com.reactnativenavigation.parse.NavigationOptions;
7
-import com.reactnativenavigation.views.ReactContainer;
7
+import com.reactnativenavigation.views.ReactComponent;
8 8
 import com.reactnativenavigation.views.TopBar;
9 9
 
10
-public class TestContainerView extends View implements ReactContainer {
10
+public class TestComponentView extends View implements ReactComponent {
11 11
 
12 12
 	private TopBar topBar;
13 13
 
14
-	public TestContainerView(final Context context) {
14
+	public TestComponentView(final Context context) {
15 15
 		super(context);
16 16
 		topBar = new TopBar(context, this);
17 17
 
@@ -32,11 +32,11 @@ public class TestContainerView extends View implements ReactContainer {
32 32
 	}
33 33
 
34 34
 	@Override
35
-	public void sendContainerStart() {
35
+	public void sendComponentStart() {
36 36
 	}
37 37
 
38 38
 	@Override
39
-	public void sendContainerStop() {
39
+	public void sendComponentStop() {
40 40
 	}
41 41
 
42 42
     @Override

+ 13
- 0
lib/android/app/src/test/java/com/reactnativenavigation/mocks/TestComponentViewCreator.java ファイルの表示

@@ -0,0 +1,13 @@
1
+package com.reactnativenavigation.mocks;
2
+
3
+import android.app.Activity;
4
+
5
+import com.reactnativenavigation.viewcontrollers.ComponentViewController;
6
+import com.reactnativenavigation.viewcontrollers.ComponentViewController.ReactViewCreator;
7
+
8
+public class TestComponentViewCreator implements ReactViewCreator {
9
+	@Override
10
+	public ComponentViewController.IReactView create(final Activity activity, final String componentId, final String componentName) {
11
+		return new TestComponentLayout(activity);
12
+	}
13
+}

+ 0
- 13
lib/android/app/src/test/java/com/reactnativenavigation/mocks/TestContainerViewCreator.java ファイルの表示

@@ -1,13 +0,0 @@
1
-package com.reactnativenavigation.mocks;
2
-
3
-import android.app.Activity;
4
-
5
-import com.reactnativenavigation.viewcontrollers.ContainerViewController;
6
-import com.reactnativenavigation.viewcontrollers.ContainerViewController.ReactViewCreator;
7
-
8
-public class TestContainerViewCreator implements ReactViewCreator {
9
-	@Override
10
-	public ContainerViewController.IReactView create(final Activity activity, final String containerId, final String containerName) {
11
-		return new TestContainerLayout(activity);
12
-	}
13
-}

+ 4
- 4
lib/android/app/src/test/java/com/reactnativenavigation/mocks/TopTabLayoutMock.java ファイルの表示

@@ -3,9 +3,9 @@ package com.reactnativenavigation.mocks;
3 3
 import android.content.Context;
4 4
 import android.view.View;
5 5
 
6
-import com.reactnativenavigation.viewcontrollers.ContainerViewController;
6
+import com.reactnativenavigation.viewcontrollers.ComponentViewController;
7 7
 
8
-public class TopTabLayoutMock extends View implements ContainerViewController.IReactView {
8
+public class TopTabLayoutMock extends View implements ComponentViewController.IReactView {
9 9
 
10 10
     public TopTabLayoutMock(Context context) {
11 11
         super(context);
@@ -27,12 +27,12 @@ public class TopTabLayoutMock extends View implements ContainerViewController.IR
27 27
     }
28 28
 
29 29
     @Override
30
-    public void sendContainerStart() {
30
+    public void sendComponentStart() {
31 31
 
32 32
     }
33 33
 
34 34
     @Override
35
-    public void sendContainerStop() {
35
+    public void sendComponentStop() {
36 36
 
37 37
     }
38 38
 

+ 7
- 7
lib/android/app/src/test/java/com/reactnativenavigation/parse/LayoutNodeParserTest.java ファイルの表示

@@ -10,16 +10,16 @@ import static org.assertj.core.api.Java6Assertions.assertThat;
10 10
 public class LayoutNodeParserTest extends BaseTest {
11 11
 	@Test
12 12
 	public void dto() throws Exception {
13
-		LayoutNode node = new LayoutNode("the id", LayoutNode.Type.Container);
13
+		LayoutNode node = new LayoutNode("the id", LayoutNode.Type.Component);
14 14
 		assertThat(node.id).isEqualTo("the id");
15
-		assertThat(node.type).isEqualTo(LayoutNode.Type.Container);
15
+		assertThat(node.type).isEqualTo(LayoutNode.Type.Component);
16 16
 		assertThat(node.data.keys()).isEmpty();
17 17
 		assertThat(node.children).isEmpty();
18 18
 	}
19 19
 
20 20
 	@Test
21 21
 	public void parseType() throws Exception {
22
-		assertThat(LayoutNode.Type.valueOf("Container")).isEqualTo(LayoutNode.Type.Container);
22
+		assertThat(LayoutNode.Type.valueOf("Component")).isEqualTo(LayoutNode.Type.Component);
23 23
 	}
24 24
 
25 25
 	@Test(expected = RuntimeException.class)
@@ -30,20 +30,20 @@ public class LayoutNodeParserTest extends BaseTest {
30 30
 	@Test
31 31
 	public void parseFromTree() throws Exception {
32 32
 		JSONObject tree = new JSONObject("{id: node1, " +
33
-				"type: ContainerStack, " +
33
+				"type: ComponentStack, " +
34 34
 				"data: {dataKey: dataValue}, " +
35
-				"children: [{id: childId1, type: Container}]}");
35
+				"children: [{id: childId1, type: Component}]}");
36 36
 
37 37
 		LayoutNode result = LayoutNodeParser.parse(tree);
38 38
 
39 39
 		assertThat(result).isNotNull();
40 40
 		assertThat(result.id).isEqualTo("node1");
41
-		assertThat(result.type).isEqualTo(LayoutNode.Type.ContainerStack);
41
+		assertThat(result.type).isEqualTo(LayoutNode.Type.ComponentStack);
42 42
 		assertThat(result.data.length()).isEqualTo(1);
43 43
 		assertThat(result.data.getString("dataKey")).isEqualTo("dataValue");
44 44
 		assertThat(result.children).hasSize(1);
45 45
 		assertThat(result.children.get(0).id).isEqualTo("childId1");
46
-		assertThat(result.children.get(0).type).isEqualTo(LayoutNode.Type.Container);
46
+		assertThat(result.children.get(0).type).isEqualTo(LayoutNode.Type.Component);
47 47
 		assertThat(result.children.get(0).data.keys()).isEmpty();
48 48
 		assertThat(result.children.get(0).children).isEmpty();
49 49
 	}

+ 1
- 1
lib/android/app/src/test/java/com/reactnativenavigation/parse/NavigationOptionsTest.java ファイルの表示

@@ -27,7 +27,7 @@ public class NavigationOptionsTest extends BaseTest {
27 27
     private static final NavigationOptions.BooleanOptions BOTTOM_TABS_ANIMATE_HIDE = True;
28 28
     private static final NavigationOptions.BooleanOptions BOTTOM_TABS_HIDDEN = True;
29 29
     private static final int BOTTOM_TABS_BADGE = 3;
30
-    private static final String BOTTOM_TABS_CURRENT_TAB_ID = "ContainerId";
30
+    private static final String BOTTOM_TABS_CURRENT_TAB_ID = "ComponentId";
31 31
     private static final int BOTTOM_TABS_CURRENT_TAB_INDEX = 1;
32 32
     private TypefaceLoader mockLoader;
33 33
 

lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/ContainerViewControllerTest.java → lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/ComponentViewControllerTest.java ファイルの表示

@@ -3,7 +3,7 @@ package com.reactnativenavigation.viewcontrollers;
3 3
 import android.app.Activity;
4 4
 
5 5
 import com.reactnativenavigation.BaseTest;
6
-import com.reactnativenavigation.mocks.TestContainerLayout;
6
+import com.reactnativenavigation.mocks.TestComponentLayout;
7 7
 import com.reactnativenavigation.parse.NavigationOptions;
8 8
 
9 9
 import org.junit.Test;
@@ -14,30 +14,30 @@ import static org.mockito.Mockito.times;
14 14
 import static org.mockito.Mockito.verify;
15 15
 import static org.mockito.Mockito.when;
16 16
 
17
-public class ContainerViewControllerTest extends BaseTest {
18
-	private ContainerViewController uut;
19
-	private ContainerViewController.IReactView view;
17
+public class ComponentViewControllerTest extends BaseTest {
18
+	private ComponentViewController uut;
19
+	private ComponentViewController.IReactView view;
20 20
 
21 21
 	@Override
22 22
 	public void beforeEach() {
23 23
 		super.beforeEach();
24 24
 		Activity activity = newActivity();
25
-		view = spy(new TestContainerLayout(activity));
26
-		uut = new ContainerViewController(activity, "containerId1", "containerName", new ContainerViewController.ReactViewCreator() {
25
+		view = spy(new TestComponentLayout(activity));
26
+		uut = new ComponentViewController(activity, "componentId1", "componentName", new ComponentViewController.ReactViewCreator() {
27 27
 			@Override
28
-			public ContainerViewController.IReactView create(final Activity activity1, final String containerId, final String containerName) {
28
+			public ComponentViewController.IReactView create(final Activity activity1, final String componentId, final String componentName) {
29 29
 				return view;
30 30
 			}
31 31
 		}, new NavigationOptions());
32 32
 	}
33 33
 
34 34
 	@Test
35
-	public void createsViewFromContainerViewCreator() throws Exception {
35
+	public void createsViewFromComponentViewCreator() throws Exception {
36 36
 		assertThat(uut.getView()).isSameAs(view);
37 37
 	}
38 38
 
39 39
 	@Test
40
-	public void containerViewDestroyedOnDestroy() throws Exception {
40
+	public void componentViewDestroyedOnDestroy() throws Exception {
41 41
 		uut.ensureViewIsCreated();
42 42
 		verify(view, times(0)).destroy();
43 43
 		uut.destroy();
@@ -45,20 +45,20 @@ public class ContainerViewControllerTest extends BaseTest {
45 45
 	}
46 46
 
47 47
 	@Test
48
-	public void lifecycleMethodsSentToContainerView() throws Exception {
48
+	public void lifecycleMethodsSentToComponentView() throws Exception {
49 49
 		uut.ensureViewIsCreated();
50
-		verify(view, times(0)).sendContainerStart();
51
-		verify(view, times(0)).sendContainerStop();
50
+		verify(view, times(0)).sendComponentStart();
51
+		verify(view, times(0)).sendComponentStop();
52 52
 		uut.onViewAppeared();
53
-		verify(view, times(1)).sendContainerStart();
54
-		verify(view, times(0)).sendContainerStop();
53
+		verify(view, times(1)).sendComponentStart();
54
+		verify(view, times(0)).sendComponentStop();
55 55
 		uut.onViewDisappear();
56
-		verify(view, times(1)).sendContainerStart();
57
-		verify(view, times(1)).sendContainerStop();
56
+		verify(view, times(1)).sendComponentStart();
57
+		verify(view, times(1)).sendComponentStop();
58 58
 	}
59 59
 
60 60
 	@Test
61
-	public void isViewShownOnlyIfContainerViewIsReady() throws Exception {
61
+	public void isViewShownOnlyIfComponentViewIsReady() throws Exception {
62 62
 		assertThat(uut.isViewShown()).isFalse();
63 63
 		uut.ensureViewIsCreated();
64 64
 		when(view.asView().isShown()).thenReturn(true);

+ 6
- 6
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/NavigatorTest.java ファイルの表示

@@ -5,7 +5,7 @@ import android.support.annotation.NonNull;
5 5
 
6 6
 import com.reactnativenavigation.BaseTest;
7 7
 import com.reactnativenavigation.mocks.MockPromise;
8
-import com.reactnativenavigation.mocks.SimpleContainerViewController;
8
+import com.reactnativenavigation.mocks.SimpleComponentViewController;
9 9
 import com.reactnativenavigation.mocks.SimpleViewController;
10 10
 import com.reactnativenavigation.mocks.TestStackAnimator;
11 11
 import com.reactnativenavigation.parse.NavigationOptions;
@@ -195,19 +195,19 @@ public class NavigatorTest extends BaseTest {
195 195
 
196 196
 	@Test
197 197
 	public void setOptions_CallsApplyNavigationOptions() {
198
-		ContainerViewController containerVc = new SimpleContainerViewController(activity, "theId");
199
-		uut.setRoot(containerVc);
200
-		assertThat(containerVc.getNavigationOptions().topBarOptions.title).isEmpty();
198
+		ComponentViewController componentVc = new SimpleComponentViewController(activity, "theId");
199
+		uut.setRoot(componentVc);
200
+		assertThat(componentVc.getNavigationOptions().topBarOptions.title).isEmpty();
201 201
 
202 202
 		NavigationOptions options = new NavigationOptions();
203 203
 		options.topBarOptions.title = "new title";
204 204
 
205 205
 		uut.setOptions("theId", options);
206
-		assertThat(containerVc.getNavigationOptions().topBarOptions.title).isEqualTo("new title");
206
+		assertThat(componentVc.getNavigationOptions().topBarOptions.title).isEqualTo("new title");
207 207
 	}
208 208
 
209 209
 	@Test
210
-	public void setOptions_AffectsOnlyContainerViewControllers() {
210
+	public void setOptions_AffectsOnlyComponentViewControllers() {
211 211
 		uut.setOptions("some unknown child id", new NavigationOptions());
212 212
 	}
213 213
 

+ 9
- 9
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/OptionsApplyingTest.java ファイルの表示

@@ -6,7 +6,7 @@ import android.graphics.drawable.ColorDrawable;
6 6
 import android.view.View;
7 7
 
8 8
 import com.reactnativenavigation.BaseTest;
9
-import com.reactnativenavigation.mocks.TestContainerLayout;
9
+import com.reactnativenavigation.mocks.TestComponentLayout;
10 10
 import com.reactnativenavigation.parse.NavigationOptions;
11 11
 
12 12
 import org.junit.Test;
@@ -16,8 +16,8 @@ import static org.mockito.Mockito.spy;
16 16
 
17 17
 public class OptionsApplyingTest extends BaseTest {
18 18
 	private Activity activity;
19
-	private ContainerViewController uut;
20
-	private ContainerViewController.IReactView view;
19
+	private ComponentViewController uut;
20
+	private ComponentViewController.IReactView view;
21 21
 	private NavigationOptions initialNavigationOptions;
22 22
 
23 23
 	@Override
@@ -25,11 +25,11 @@ public class OptionsApplyingTest extends BaseTest {
25 25
 		super.beforeEach();
26 26
 		activity = newActivity();
27 27
 		initialNavigationOptions = new NavigationOptions();
28
-		view = spy(new TestContainerLayout(activity));
29
-		uut = new ContainerViewController(activity,
30
-                "containerId1",
31
-                "containerName",
32
-                (activity1, containerId, containerName) -> view,
28
+		view = spy(new TestComponentLayout(activity));
29
+		uut = new ComponentViewController(activity,
30
+                "componentId1",
31
+                "componentName",
32
+                (activity1, componentId, componentName) -> view,
33 33
                 initialNavigationOptions
34 34
         );
35 35
 		uut.ensureViewIsCreated();
@@ -134,4 +134,4 @@ public class OptionsApplyingTest extends BaseTest {
134 134
 
135 135
 		assertThat(uut.getTopBar().getVisibility()).isEqualTo(View.GONE);
136 136
 	}
137
-}
137
+}

+ 4
- 4
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/TopTabControllerTest.java ファイルの表示

@@ -26,12 +26,12 @@ public class TopTabControllerTest extends BaseTest {
26 26
         view = spy(new TopTabLayoutMock(activity));
27 27
         initialOptions = new NavigationOptions();
28 28
         uut = new TopTabController(activity,
29
-                "containerId",
30
-                "containerName",
31
-                (activity1, containerId, containerName) -> view,
29
+                "componentId",
30
+                "componentName",
31
+                (activity1, componentId, componentName) -> view,
32 32
                 initialOptions
33 33
         );
34
-        parentController = spy(new TopTabsControllerMock(activity, "parentContainerId"));
34
+        parentController = spy(new TopTabsControllerMock(activity, "parentComponentId"));
35 35
         uut.setParentController(parentController);
36 36
     }
37 37
 

+ 12
- 12
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/TopTabsViewControllerTest.java ファイルの表示

@@ -6,7 +6,7 @@ import android.view.ViewGroup;
6 6
 import com.reactnativenavigation.BaseTest;
7 7
 import com.reactnativenavigation.mocks.TopTabLayoutMock;
8 8
 import com.reactnativenavigation.parse.NavigationOptions;
9
-import com.reactnativenavigation.viewcontrollers.ContainerViewController.IReactView;
9
+import com.reactnativenavigation.viewcontrollers.ComponentViewController.IReactView;
10 10
 import com.reactnativenavigation.viewcontrollers.toptabs.TopTabController;
11 11
 import com.reactnativenavigation.viewcontrollers.toptabs.TopTabsAdapter;
12 12
 import com.reactnativenavigation.viewcontrollers.toptabs.TopTabsController;
@@ -46,7 +46,7 @@ public class TopTabsViewControllerTest extends BaseTest {
46 46
 
47 47
         TopTabsLayoutCreator layoutCreator = Mockito.mock(TopTabsLayoutCreator.class);
48 48
         Mockito.when(layoutCreator.create()).thenReturn(topTabsLayout);
49
-        uut = new TopTabsController(activity, "containerId", tabControllers, layoutCreator, navigationOptions);
49
+        uut = new TopTabsController(activity, "componentId", tabControllers, layoutCreator, navigationOptions);
50 50
     }
51 51
 
52 52
     private void createTabs(Activity activity) {
@@ -57,14 +57,14 @@ public class TopTabsViewControllerTest extends BaseTest {
57 57
             tabControllers.add(spy(new TopTabController(activity,
58 58
                     "idTab" + i,
59 59
                     "tab" + i,
60
-                    (activity1, containerId, containerName) -> reactView,
60
+                    (activity1, componentId, componentName) -> reactView,
61 61
                     tabOptions.get(i))
62 62
             ));
63 63
         }
64 64
     }
65 65
 
66 66
     @Test
67
-    public void createsViewFromContainerViewCreator() throws Exception {
67
+    public void createsViewFromComponentViewCreator() throws Exception {
68 68
         uut.ensureViewIsCreated();
69 69
         for (int i = 0; i < SIZE; i++) {
70 70
             verify(tabControllers.get(i), times(1)).createView();
@@ -72,7 +72,7 @@ public class TopTabsViewControllerTest extends BaseTest {
72 72
     }
73 73
 
74 74
     @Test
75
-    public void containerViewDestroyedOnDestroy() throws Exception {
75
+    public void componentViewDestroyedOnDestroy() throws Exception {
76 76
         uut.ensureViewIsCreated();
77 77
         TopTabsLayout topTabs = (TopTabsLayout) uut.getView();
78 78
         for (int i = 0; i < SIZE; i++) {
@@ -91,9 +91,9 @@ public class TopTabsViewControllerTest extends BaseTest {
91 91
         TopTabLayoutMock selectedTab = tabs.get(1);
92 92
         uut.onViewAppeared();
93 93
         uut.switchToTab(1);
94
-        verify(initialTab, times(1)).sendContainerStop();
95
-        verify(selectedTab, times(1)).sendContainerStart();
96
-        verify(selectedTab, times(0)).sendContainerStop();
94
+        verify(initialTab, times(1)).sendComponentStop();
95
+        verify(selectedTab, times(1)).sendComponentStart();
96
+        verify(selectedTab, times(0)).sendComponentStop();
97 97
     }
98 98
 
99 99
     @Test
@@ -102,10 +102,10 @@ public class TopTabsViewControllerTest extends BaseTest {
102 102
         uut.onViewAppeared();
103 103
         uut.switchToTab(1);
104 104
         uut.switchToTab(0);
105
-        verify(tabs.get(0), times(1)).sendContainerStop();
106
-        verify(tabs.get(0), times(2)).sendContainerStart();
107
-        verify(tabs.get(1), times(1)).sendContainerStart();
108
-        verify(tabs.get(1), times(1)).sendContainerStop();
105
+        verify(tabs.get(0), times(1)).sendComponentStop();
106
+        verify(tabs.get(0), times(2)).sendComponentStart();
107
+        verify(tabs.get(1), times(1)).sendComponentStart();
108
+        verify(tabs.get(1), times(1)).sendComponentStop();
109 109
     }
110 110
 
111 111
     @Test