Browse Source

navigator setRoot

Daniel Zlotin 7 years ago
parent
commit
1194467226

+ 0
- 18
lib/android/app/src/main/java/com/reactnativenavigation/Store.java View File

@@ -1,18 +0,0 @@
1
-package com.reactnativenavigation;
2
-
3
-import com.reactnativenavigation.viewcontrollers.ViewController;
4
-
5
-import java.util.HashMap;
6
-import java.util.Map;
7
-
8
-public class Store {
9
-	private Map<String, ViewController> viewControllersById = new HashMap<>();
10
-
11
-	public void setViewController(String id, ViewController viewController) {
12
-		viewControllersById.put(id, viewController);
13
-	}
14
-
15
-	public ViewController getViewController(String id) {
16
-		return viewControllersById.get(id);
17
-	}
18
-}

+ 3
- 1
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/NavigatorTest.java View File

@@ -52,12 +52,14 @@ public class NavigatorTest extends BaseTest {
52 52
 	}
53 53
 
54 54
 	@Test
55
-	public void setRoot_ReplacesExistingChildControllerView() throws Exception {
55
+	public void setRoot_ReplacesExistingChildControllerViews() throws Exception {
56 56
 		uut.setRoot(child1);
57 57
 		uut.setRoot(child2);
58 58
 		assertHasSingleChildViewOf(child2);
59 59
 	}
60 60
 
61
+
62
+
61 63
 	private void assertHasSingleChildViewOf(ViewController vc) {
62 64
 		assertThat(uut.getView().getChildCount()).isEqualTo(1);
63 65
 		assertThat(uut.getView().getChildAt(0)).isEqualTo(vc.getView()).isNotNull();