Browse Source

navigator pop

Daniel Zlotin 7 years ago
parent
commit
4917d990ed

+ 1
- 1
lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java View File

@@ -59,7 +59,7 @@ public class NavigationModule extends ReactContextBaseJavaModule {
59 59
 		handle(new Runnable() {
60 60
 			@Override
61 61
 			public void run() {
62
-//				store.getViewController(onContainerId).getStackController().pop(store.getViewController(onContainerId));
62
+				navigator().pop(onContainerId);
63 63
 			}
64 64
 		});
65 65
 	}

+ 2
- 1
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/BottomTabsController.java View File

@@ -7,6 +7,7 @@ import android.support.design.widget.BottomNavigationView;
7 7
 import android.view.Menu;
8 8
 import android.view.MenuItem;
9 9
 import android.view.View;
10
+import android.view.ViewGroup;
10 11
 import android.widget.RelativeLayout;
11 12
 
12 13
 import com.reactnativenavigation.utils.CompatUtils;
@@ -31,7 +32,7 @@ public class BottomTabsController extends ParentController implements BottomNavi
31 32
 
32 33
 	@NonNull
33 34
 	@Override
34
-	protected RelativeLayout createView() {
35
+	protected ViewGroup createView() {
35 36
 		RelativeLayout root = new RelativeLayout(getActivity());
36 37
 		bottomNavigationView = new BottomNavigationView(getActivity());
37 38
 		bottomNavigationView.setId(CompatUtils.generateViewId());

+ 2
- 2
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/Navigator.java View File

@@ -2,7 +2,7 @@ package com.reactnativenavigation.viewcontrollers;
2 2
 
3 3
 import android.app.Activity;
4 4
 import android.support.annotation.NonNull;
5
-import android.view.View;
5
+import android.view.ViewGroup;
6 6
 import android.widget.FrameLayout;
7 7
 
8 8
 import com.reactnativenavigation.utils.CompatUtils;
@@ -21,7 +21,7 @@ public class Navigator extends ParentController {
21 21
 
22 22
 	@NonNull
23 23
 	@Override
24
-	protected View createView() {
24
+	protected ViewGroup createView() {
25 25
 		return new FrameLayout(getActivity());
26 26
 	}
27 27
 

+ 1
- 2
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ParentController.java View File

@@ -3,7 +3,6 @@ package com.reactnativenavigation.viewcontrollers;
3 3
 import android.app.Activity;
4 4
 import android.support.annotation.NonNull;
5 5
 import android.support.annotation.Nullable;
6
-import android.view.View;
7 6
 import android.view.ViewGroup;
8 7
 
9 8
 import java.util.Collection;
@@ -21,7 +20,7 @@ public abstract class ParentController extends ViewController {
21 20
 
22 21
 	@NonNull
23 22
 	@Override
24
-	protected abstract View createView();
23
+	protected abstract ViewGroup createView();
25 24
 
26 25
 	public abstract Collection<ViewController> getChildControllers();
27 26
 

+ 4
- 5
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/ParentControllerTest.java View File

@@ -2,7 +2,6 @@ package com.reactnativenavigation.viewcontrollers;
2 2
 
3 3
 import android.app.Activity;
4 4
 import android.support.annotation.NonNull;
5
-import android.view.View;
6 5
 import android.view.ViewGroup;
7 6
 import android.widget.FrameLayout;
8 7
 
@@ -37,7 +36,7 @@ public class ParentControllerTest extends BaseTest {
37 36
 
38 37
 			@NonNull
39 38
 			@Override
40
-			protected View createView() {
39
+			protected ViewGroup createView() {
41 40
 				return new FrameLayout(activity);
42 41
 			}
43 42
 		};
@@ -55,7 +54,7 @@ public class ParentControllerTest extends BaseTest {
55 54
 
56 55
 			@NonNull
57 56
 			@Override
58
-			protected View createView() {
57
+			protected ViewGroup createView() {
59 58
 				return new FrameLayout(activity);
60 59
 			}
61 60
 		};
@@ -81,7 +80,7 @@ public class ParentControllerTest extends BaseTest {
81 80
 
82 81
 			@NonNull
83 82
 			@Override
84
-			protected View createView() {
83
+			protected ViewGroup createView() {
85 84
 				return new FrameLayout(activity);
86 85
 			}
87 86
 		};
@@ -108,7 +107,7 @@ public class ParentControllerTest extends BaseTest {
108 107
 
109 108
 			@NonNull
110 109
 			@Override
111
-			protected View createView() {
110
+			protected ViewGroup createView() {
112 111
 				return new FrameLayout(activity);
113 112
 			}
114 113
 		};