|
@@ -7,16 +7,16 @@ import com.facebook.react.ReactRootView;
|
7
|
7
|
import com.reactnativenavigation.NavigationActivity;
|
8
|
8
|
import com.reactnativenavigation.NavigationApplication;
|
9
|
9
|
import com.reactnativenavigation.layout.LayoutFactory;
|
|
10
|
+import com.reactnativenavigation.layout.LayoutNode;
|
10
|
11
|
import com.reactnativenavigation.layout.StackLayout;
|
11
|
12
|
import com.reactnativenavigation.layout.bottomtabs.BottomTabsCreator;
|
12
|
|
-import com.reactnativenavigation.layout.parse.LayoutNode;
|
13
|
|
-import com.reactnativenavigation.utils.UiThread;
|
14
|
13
|
|
15
|
14
|
import org.json.JSONObject;
|
16
|
15
|
|
17
|
16
|
public class CommandsHandler {
|
18
|
17
|
|
19
|
18
|
public void setRoot(final NavigationActivity activity, final JSONObject layoutTree) {
|
|
19
|
+ final LayoutNode layoutTreeRoot = LayoutNode.parse(layoutTree);
|
20
|
20
|
LayoutFactory factory =
|
21
|
21
|
new LayoutFactory(activity, new LayoutFactory.ReactRootViewCreator() {
|
22
|
22
|
@Override
|
|
@@ -29,7 +29,6 @@ public class CommandsHandler {
|
29
|
29
|
}
|
30
|
30
|
}, new BottomTabsCreator());
|
31
|
31
|
|
32
|
|
- final LayoutNode layoutTreeRoot = LayoutNode.parse(layoutTree);
|
33
|
32
|
final View rootView = factory.create(layoutTreeRoot);
|
34
|
33
|
activity.setContentView(rootView);
|
35
|
34
|
}
|
|
@@ -52,11 +51,6 @@ public class CommandsHandler {
|
52
|
51
|
}
|
53
|
52
|
|
54
|
53
|
public void pop(final NavigationActivity activity, String onContainerId) {
|
55
|
|
- UiThread.post(new Runnable() {
|
56
|
|
- @Override
|
57
|
|
- public void run() {
|
58
|
|
- ((StackLayout) activity.getContentView()).pop();
|
59
|
|
- }
|
60
|
|
- });
|
|
54
|
+ ((StackLayout) activity.getContentView()).pop();
|
61
|
55
|
}
|
62
|
56
|
}
|