Explorar el Código

rename container->component android

Daniel Zlotin hace 7 años
padre
commit
c032c0d045

+ 7
- 7
lib/android/app/src/main/java/com/reactnativenavigation/parse/LayoutFactory.java Ver fichero

@@ -37,8 +37,8 @@ public class LayoutFactory {
37 37
 		switch (node.type) {
38 38
 			case Component:
39 39
 				return createComponent(node);
40
-			case ComponentStack:
41
-				return createComponentStack(node);
40
+			case Stack:
41
+				return createStack(node);
42 42
 			case BottomTabs:
43 43
 				return createBottomTabs(node);
44 44
 			case SideMenuRoot:
@@ -49,12 +49,12 @@ public class LayoutFactory {
49 49
 				return createSideMenuLeft(node);
50 50
 			case SideMenuRight:
51 51
 				return createSideMenuRight(node);
52
-			case CustomDialog:
53
-				return createDialogComponent(node);
52
+//			case CustomDialog:
53
+//				return createDialogComponent(node);
54 54
             case TopTabs:
55 55
                 return createTopTabs(node);
56
-            case TopTab:
57
-                return createTopTab(node);
56
+//            case TopTab:
57
+//                return createTopTab(node);
58 58
 			default:
59 59
 				throw new IllegalArgumentException("Invalid node type: " + node.type);
60 60
 		}
@@ -105,7 +105,7 @@ public class LayoutFactory {
105 105
         );
106 106
 	}
107 107
 
108
-	private ViewController createComponentStack(LayoutNode node) {
108
+	private ViewController createStack(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);

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

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

+ 2
- 2
lib/android/app/src/test/java/com/reactnativenavigation/parse/LayoutNodeParserTest.java Ver fichero

@@ -30,7 +30,7 @@ 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: ComponentStack, " +
33
+				"type: Stack, " +
34 34
 				"data: {dataKey: dataValue}, " +
35 35
 				"children: [{id: childId1, type: Component}]}");
36 36
 
@@ -38,7 +38,7 @@ public class LayoutNodeParserTest extends BaseTest {
38 38
 
39 39
 		assertThat(result).isNotNull();
40 40
 		assertThat(result.id).isEqualTo("node1");
41
-		assertThat(result.type).isEqualTo(LayoutNode.Type.ComponentStack);
41
+		assertThat(result.type).isEqualTo(LayoutNode.Type.Stack);
42 42
 		assertThat(result.data.length()).isEqualTo(1);
43 43
 		assertThat(result.data.getString("dataKey")).isEqualTo("dataValue");
44 44
 		assertThat(result.children).hasSize(1);