[RN] Add workaround for loading different URLs on Android

Changing the props from native (Java) code was only added in 0.45, so add a
workaround until we get to updating our React Native dependency.
This commit is contained in:
Saúl Ibarra Corretgé 2017-06-08 18:09:54 +02:00 committed by Lyubo Marinov
parent a075f24000
commit 84463d8cf0
1 changed files with 10 additions and 8 deletions

View File

@ -142,15 +142,17 @@ public class JitsiMeetView extends FrameLayout {
props.putString("url", url.toString()); props.putString("url", url.toString());
} }
if (mReactRootView == null) { // TODO: ReactRootView#setAppProperties is only available on React Native 0.45, so destroy
mReactRootView = new ReactRootView(getContext()); // the current root view and create a new one.
mReactRootView.startReactApplication(mReactInstanceManager, "App", props); if (mReactRootView != null) {
mReactRootView.setBackgroundColor(BACKGROUND_COLOR); removeView(mReactRootView);
addView(mReactRootView); mReactRootView = null;
} else {
// TODO: ReactRootView#setAppProperties is only available on React Native 0.45.
throw new RuntimeException("Not yet supported");
} }
mReactRootView = new ReactRootView(getContext());
mReactRootView.startReactApplication(mReactInstanceManager, "App", props);
mReactRootView.setBackgroundColor(BACKGROUND_COLOR);
addView(mReactRootView);
} }
/** /**