|
@@ -47,7 +47,6 @@ public class RctView extends FrameLayout {
|
47
|
47
|
};
|
48
|
48
|
private boolean mIsScrollEventListenerRegistered = false;
|
49
|
49
|
|
50
|
|
-
|
51
|
50
|
private final View.OnAttachStateChangeListener mStateChangeListener =
|
52
|
51
|
new View.OnAttachStateChangeListener() {
|
53
|
52
|
@Override
|
|
@@ -100,9 +99,8 @@ public class RctView extends FrameLayout {
|
100
|
99
|
super(ctx);
|
101
|
100
|
setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
|
102
|
101
|
|
103
|
|
- OnDisplayedListener onDisplayedListenerInternal = onDisplayedListener;
|
104
|
|
- if (screen.bottomTabsHiddenOnScroll) {
|
105
|
|
- onDisplayedListenerInternal = new OnDisplayedListener() {
|
|
102
|
+ final OnDisplayedListener onDisplayedListenerInternal = screen.bottomTabsHiddenOnScroll ?
|
|
103
|
+ new OnDisplayedListener() {
|
106
|
104
|
@Override
|
107
|
105
|
public void onDisplayed() {
|
108
|
106
|
if (onDisplayedListener != null) {
|
|
@@ -111,13 +109,18 @@ public class RctView extends FrameLayout {
|
111
|
109
|
|
112
|
110
|
setupScrollViewWithBottomTabs();
|
113
|
111
|
}
|
114
|
|
- };
|
115
|
|
- }
|
|
112
|
+ } : onDisplayedListener;
|
116
|
113
|
|
117
|
114
|
mReactRootView = new RnnReactRootView(ctx, onDisplayedListenerInternal);
|
118
|
115
|
mReactRootView.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
|
119
|
|
-
|
|
116
|
+ Bundle passProps = createPassProps(screen);
|
120
|
117
|
String componentName = screen.screenId;
|
|
118
|
+ mReactRootView.startReactApplication(rctInstanceManager, componentName, passProps);
|
|
119
|
+
|
|
120
|
+ addView(mReactRootView);
|
|
121
|
+ }
|
|
122
|
+
|
|
123
|
+ private Bundle createPassProps(Screen screen) {
|
121
|
124
|
Bundle passProps = new Bundle();
|
122
|
125
|
passProps.putString(Screen.KEY_SCREEN_INSTANCE_ID, screen.screenInstanceId);
|
123
|
126
|
passProps.putString(Screen.KEY_NAVIGATOR_ID, screen.navigatorId);
|
|
@@ -125,10 +128,7 @@ public class RctView extends FrameLayout {
|
125
|
128
|
if (screen.passedProps != null) {
|
126
|
129
|
BridgeUtils.addMapToBundle(screen.passedProps, passProps);
|
127
|
130
|
}
|
128
|
|
-
|
129
|
|
- mReactRootView.startReactApplication(rctInstanceManager, componentName, passProps);
|
130
|
|
-
|
131
|
|
- addView(mReactRootView);
|
|
131
|
+ return passProps;
|
132
|
132
|
}
|
133
|
133
|
|
134
|
134
|
private void setupScrollViewWithBottomTabs() {
|