mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 20:01:01 +08:00
Update size of Root ShadowNode when RootView changes its size
Summary: This diff updates the size of RootShadowNode and re-render RN views when the Size of the Android React View changes Reviewed By: achen1 Differential Revision: D9173758 fbshipit-source-id: 7cc6bbfb646025c3ec1773ab041eb9207623af71
This commit is contained in:
committed by
Facebook Github Bot
parent
575f7d478d
commit
8b5e3fc16b
@@ -512,16 +512,21 @@ public class FabricUIManager implements UIManager, JSHandler, FabricBinder {
|
||||
|
||||
@Override
|
||||
@DoNotStrip
|
||||
public synchronized void updateRootLayoutSpecs(int rootViewTag, int widthMeasureSpec, int heightMeasureSpec) {
|
||||
ReactShadowNode rootNode = getRootNode(rootViewTag);
|
||||
if (rootNode == null) {
|
||||
FLog.w(ReactConstants.TAG, "Tried to update non-existent root tag: " + rootViewTag);
|
||||
return;
|
||||
}
|
||||
public synchronized void updateRootLayoutSpecs(final int rootViewTag, final int widthMeasureSpec, final int heightMeasureSpec) {
|
||||
mReactApplicationContext.runOnNativeModulesQueueThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ReactShadowNode rootNode = getRootNode(rootViewTag);
|
||||
if (rootNode == null) {
|
||||
FLog.w(ReactConstants.TAG, "Tried to update non-existent root tag: " + rootViewTag);
|
||||
return;
|
||||
}
|
||||
|
||||
ReactShadowNode newRootNode = rootNode.mutableCopy(rootNode.getInstanceHandle());
|
||||
updateRootView(newRootNode, widthMeasureSpec, heightMeasureSpec);
|
||||
mRootShadowNodeRegistry.replaceNode(newRootNode);
|
||||
ReactShadowNode newRootNode = rootNode.mutableCopy(rootNode.getInstanceHandle());
|
||||
updateRootView(newRootNode, widthMeasureSpec, heightMeasureSpec);
|
||||
mRootShadowNodeRegistry.replaceNode(newRootNode);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user