Browse Source

rename container->component android

Daniel Zlotin 7 years ago
parent
commit
c032c0d045

+ 7
- 7
lib/android/app/src/main/java/com/reactnativenavigation/parse/LayoutFactory.java View File

37
 		switch (node.type) {
37
 		switch (node.type) {
38
 			case Component:
38
 			case Component:
39
 				return createComponent(node);
39
 				return createComponent(node);
40
-			case ComponentStack:
41
-				return createComponentStack(node);
40
+			case Stack:
41
+				return createStack(node);
42
 			case BottomTabs:
42
 			case BottomTabs:
43
 				return createBottomTabs(node);
43
 				return createBottomTabs(node);
44
 			case SideMenuRoot:
44
 			case SideMenuRoot:
49
 				return createSideMenuLeft(node);
49
 				return createSideMenuLeft(node);
50
 			case SideMenuRight:
50
 			case SideMenuRight:
51
 				return createSideMenuRight(node);
51
 				return createSideMenuRight(node);
52
-			case CustomDialog:
53
-				return createDialogComponent(node);
52
+//			case CustomDialog:
53
+//				return createDialogComponent(node);
54
             case TopTabs:
54
             case TopTabs:
55
                 return createTopTabs(node);
55
                 return createTopTabs(node);
56
-            case TopTab:
57
-                return createTopTab(node);
56
+//            case TopTab:
57
+//                return createTopTab(node);
58
 			default:
58
 			default:
59
 				throw new IllegalArgumentException("Invalid node type: " + node.type);
59
 				throw new IllegalArgumentException("Invalid node type: " + node.type);
60
 		}
60
 		}
105
         );
105
         );
106
 	}
106
 	}
107
 
107
 
108
-	private ViewController createComponentStack(LayoutNode node) {
108
+	private ViewController createStack(LayoutNode node) {
109
 		StackController stackController = new StackController(activity, node.id);
109
 		StackController stackController = new StackController(activity, node.id);
110
 		for (LayoutNode child : node.children) {
110
 		for (LayoutNode child : node.children) {
111
 			stackController.push(create(child), null);
111
 			stackController.push(create(child), null);

+ 2
- 4
lib/android/app/src/main/java/com/reactnativenavigation/parse/LayoutNode.java View File

8
 public class LayoutNode {
8
 public class LayoutNode {
9
 	public enum Type {
9
 	public enum Type {
10
 		Component,
10
 		Component,
11
-		ComponentStack,
11
+		Stack,
12
 		BottomTabs,
12
 		BottomTabs,
13
 		SideMenuRoot,
13
 		SideMenuRoot,
14
 		SideMenuCenter,
14
 		SideMenuCenter,
15
 		SideMenuLeft,
15
 		SideMenuLeft,
16
 		SideMenuRight,
16
 		SideMenuRight,
17
-		CustomDialog,
18
-        TopTabs,
19
-        TopTab
17
+        TopTabs
20
 	}
18
 	}
21
 
19
 
22
 	public final String id;
20
 	public final String id;

+ 2
- 2
lib/android/app/src/test/java/com/reactnativenavigation/parse/LayoutNodeParserTest.java View File

30
 	@Test
30
 	@Test
31
 	public void parseFromTree() throws Exception {
31
 	public void parseFromTree() throws Exception {
32
 		JSONObject tree = new JSONObject("{id: node1, " +
32
 		JSONObject tree = new JSONObject("{id: node1, " +
33
-				"type: ComponentStack, " +
33
+				"type: Stack, " +
34
 				"data: {dataKey: dataValue}, " +
34
 				"data: {dataKey: dataValue}, " +
35
 				"children: [{id: childId1, type: Component}]}");
35
 				"children: [{id: childId1, type: Component}]}");
36
 
36
 
38
 
38
 
39
 		assertThat(result).isNotNull();
39
 		assertThat(result).isNotNull();
40
 		assertThat(result.id).isEqualTo("node1");
40
 		assertThat(result.id).isEqualTo("node1");
41
-		assertThat(result.type).isEqualTo(LayoutNode.Type.ComponentStack);
41
+		assertThat(result.type).isEqualTo(LayoutNode.Type.Stack);
42
 		assertThat(result.data.length()).isEqualTo(1);
42
 		assertThat(result.data.length()).isEqualTo(1);
43
 		assertThat(result.data.getString("dataKey")).isEqualTo("dataValue");
43
 		assertThat(result.data.getString("dataKey")).isEqualTo("dataValue");
44
 		assertThat(result.children).hasSize(1);
44
 		assertThat(result.children).hasSize(1);