Daniel Zlotin hace 7 años
padre
commit
d1078019f5

+ 4
- 3
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/NavigationController.java Ver fichero

@@ -1,9 +1,10 @@
1 1
 package com.reactnativenavigation.viewcontrollers;
2 2
 
3
-import java.util.Stack;
3
+import java.util.ArrayDeque;
4 4
 
5 5
 public class NavigationController extends ViewController {
6
-	private Stack<ViewController> childControllers = new Stack<>();
6
+
7
+	private ArrayDeque<ViewController> childControllers = new ArrayDeque<>();
7 8
 
8 9
 	public NavigationController(ViewController... childControllers) {
9 10
 		for (ViewController childController : childControllers) {
@@ -11,7 +12,7 @@ public class NavigationController extends ViewController {
11 12
 		}
12 13
 	}
13 14
 
14
-	public Stack<ViewController> getChildControllers() {
15
+	public ArrayDeque<ViewController> getChildControllers() {
15 16
 		return childControllers;
16 17
 	}
17 18
 

+ 2
- 2
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/NavigationControllerTest.java Ver fichero

@@ -19,7 +19,7 @@ public class NavigationControllerTest extends BaseTest {
19 19
 		ViewController c1 = new ViewController();
20 20
 		ViewController c2 = new ViewController();
21 21
 		ViewController c3 = new ViewController();
22
-		assertThat(new NavigationController(c1, c2, c3).getChildControllers()).containsExactly(c1, c2, c3);
22
+		assertThat(new NavigationController(c1, c2, c3).getChildControllers()).containsExactly(c3, c2, c1);
23 23
 	}
24 24
 
25 25
 	@Test
@@ -38,7 +38,7 @@ public class NavigationControllerTest extends BaseTest {
38 38
 		ViewController c2 = new ViewController();
39 39
 		uut.push(c1);
40 40
 		uut.push(c2);
41
-		assertThat(uut.getChildControllers()).containsExactly(c1, c2);
41
+		assertThat(uut.getChildControllers()).containsExactly(c2, c1);
42 42
 		uut.pop();
43 43
 		assertThat(uut.getChildControllers()).containsExactly(c1);
44 44
 		uut.pop();