|
@@ -1,6 +1,7 @@
|
1
|
1
|
package com.reactnativenavigation.controllers;
|
2
|
2
|
|
3
|
3
|
import android.os.Bundle;
|
|
4
|
+import android.support.annotation.Nullable;
|
4
|
5
|
import android.support.v7.app.AppCompatActivity;
|
5
|
6
|
import android.view.View;
|
6
|
7
|
|
|
@@ -11,7 +12,6 @@ import com.facebook.react.bridge.ReactContext;
|
11
|
12
|
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
|
12
|
13
|
import com.facebook.react.shell.MainReactPackage;
|
13
|
14
|
import com.reactnativenavigation.R;
|
14
|
|
-import com.reactnativenavigation.layout.StackLayout;
|
15
|
15
|
import com.reactnativenavigation.react.NavigationEventEmitter;
|
16
|
16
|
import com.reactnativenavigation.react.NavigationPackage;
|
17
|
17
|
import com.reactnativenavigation.react.ReactDevPermission;
|
|
@@ -22,7 +22,7 @@ import java.util.List;
|
22
|
22
|
public class NavigationActivity extends AppCompatActivity implements DefaultHardwareBackBtnHandler {
|
23
|
23
|
public static NavigationActivity instance;
|
24
|
24
|
private ReactNativeHost host;
|
25
|
|
- private StackLayout root;
|
|
25
|
+ private View contentView;
|
26
|
26
|
|
27
|
27
|
@Override
|
28
|
28
|
public void onCreate(Bundle savedInstanceState) {
|
|
@@ -53,6 +53,17 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
|
53
|
53
|
});
|
54
|
54
|
}
|
55
|
55
|
|
|
56
|
+ @Override
|
|
57
|
+ public void setContentView(View contentView) {
|
|
58
|
+ super.setContentView(contentView);
|
|
59
|
+ this.contentView = contentView;
|
|
60
|
+ }
|
|
61
|
+
|
|
62
|
+ @Nullable
|
|
63
|
+ public View getContentView() {
|
|
64
|
+ return contentView;
|
|
65
|
+ }
|
|
66
|
+
|
56
|
67
|
@Override
|
57
|
68
|
protected void onResume() {
|
58
|
69
|
super.onResume();
|
|
@@ -85,17 +96,4 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
|
85
|
96
|
public ReactNativeHost getHost() {
|
86
|
97
|
return host;
|
87
|
98
|
}
|
88
|
|
-
|
89
|
|
- public void setRoot(StackLayout rootView) {
|
90
|
|
- this.root = rootView;
|
91
|
|
- setContentView(rootView.asView());
|
92
|
|
- }
|
93
|
|
-
|
94
|
|
- public void push(View view) {
|
95
|
|
- root.push(view);
|
96
|
|
- }
|
97
|
|
-
|
98
|
|
- public void pop() {
|
99
|
|
- root.pop();
|
100
|
|
- }
|
101
|
99
|
}
|