mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
mostly working on Android + OTA
Summary: It works great on iOS, and mostly works on Android, and is now OTA'able as part of the screen config! Haven't done template view yet. One remaining issue: Layout is borked on Android. I'm guessing the issue has to do with the timing of setting the constraints in `updateRootLayoutSpecs` and calling `mBinding.startSurface` which actually builds the shadow tree. If I try to call `updateRootLayoutSpecs` earlier, it just crashes immediately. Here's the layout it spits out, which clearly has -440 for the x of 420006, which is the RCTText component, causing it to get cut off on the left of the screen: ``` updateLayoutMountItem for reactTag: 420006 x: -440, y: -13, width: 931, height: 78 updateLayoutMountItem for reactTag: 420010 x: 26, y: 79, width: 0, height: 1651 updateLayoutMountItem for reactTag: 420012 x: 0, y: 26, width: 0, height: 158 updateLayoutMountItem for reactTag: 420016 x: 0, y: 210, width: 454, height: 454 updateLayoutMountItem for reactTag: 420018 x: 454, y: 210, width: 455, height: 454 updateLayoutMountItem for reactTag: 420022 x: 0, y: 690, width: 454, height: 454 updateLayoutMountItem for reactTag: 420024 x: 454, y: 690, width: 455, height: 454 updateLayoutMountItem for reactTag: 420028 x: 0, y: 1171, width: 454, height: 454 updateLayoutMountItem for reactTag: 420030 x: 454, y: 1171, width: 455, height: 454 updateLayoutMountItem for reactTag: 420032 x: 0, y: 1651, width: 0, height: 0 ``` Reviewed By: mdvacca Differential Revision: D12813192 fbshipit-source-id: 450d646af4883ff25184141721351da67b091b7c
This commit is contained in:
committed by
Facebook Github Bot
parent
aab01608ba
commit
7b5277bb75
@@ -82,6 +82,7 @@ public class ReactRootView extends SizeMonitoringFrameLayout
|
||||
private @Nullable ReactInstanceManager mReactInstanceManager;
|
||||
private @Nullable String mJSModuleName;
|
||||
private @Nullable Bundle mAppProperties;
|
||||
private @Nullable String mInitialUITemplate;
|
||||
private @Nullable CustomGlobalLayoutListener mCustomGlobalLayoutListener;
|
||||
private @Nullable ReactRootViewEventListener mRootViewEventListener;
|
||||
private int mRootViewTag;
|
||||
@@ -343,6 +344,13 @@ public class ReactRootView extends SizeMonitoringFrameLayout
|
||||
startReactApplication(reactInstanceManager, moduleName, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@see #startReactApplication(ReactInstanceManager, String, android.os.Bundle, String)}
|
||||
*/
|
||||
public void startReactApplication(ReactInstanceManager reactInstanceManager, String moduleName, @Nullable Bundle initialProperties) {
|
||||
startReactApplication(reactInstanceManager, moduleName, initialProperties, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedule rendering of the react component rendered by the JS application from the given JS
|
||||
* module (@{param moduleName}) using provided {@param reactInstanceManager} to attach to the
|
||||
@@ -352,7 +360,8 @@ public class ReactRootView extends SizeMonitoringFrameLayout
|
||||
public void startReactApplication(
|
||||
ReactInstanceManager reactInstanceManager,
|
||||
String moduleName,
|
||||
@Nullable Bundle initialProperties) {
|
||||
@Nullable Bundle initialProperties,
|
||||
@Nullable String initialUITemplate) {
|
||||
Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "startReactApplication");
|
||||
try {
|
||||
UiThreadUtil.assertOnUiThread();
|
||||
@@ -367,6 +376,7 @@ public class ReactRootView extends SizeMonitoringFrameLayout
|
||||
mReactInstanceManager = reactInstanceManager;
|
||||
mJSModuleName = moduleName;
|
||||
mAppProperties = initialProperties;
|
||||
mInitialUITemplate = initialUITemplate;
|
||||
|
||||
if (!mReactInstanceManager.hasStartedCreatingInitialContext()) {
|
||||
mReactInstanceManager.createReactContextInBackground();
|
||||
@@ -449,6 +459,10 @@ public class ReactRootView extends SizeMonitoringFrameLayout
|
||||
return mAppProperties;
|
||||
}
|
||||
|
||||
public @Nullable String getInitialUITemplate() {
|
||||
return mInitialUITemplate;
|
||||
}
|
||||
|
||||
public void setAppProperties(@Nullable Bundle appProperties) {
|
||||
UiThreadUtil.assertOnUiThread();
|
||||
mAppProperties = appProperties;
|
||||
|
||||
Reference in New Issue
Block a user