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:
David Vacca
2018-08-28 22:49:26 -07:00
committed by Facebook Github Bot
parent 575f7d478d
commit 8b5e3fc16b
4 changed files with 33 additions and 21 deletions

View File

@@ -784,9 +784,15 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
* Updates the styles of the {@link ReactShadowNode} based on the Measure specs received by
* parameters.
*/
public void updateRootLayoutSpecs(int rootViewTag, int widthMeasureSpec, int heightMeasureSpec) {
mUIImplementation.updateRootView(rootViewTag, widthMeasureSpec, heightMeasureSpec);
mUIImplementation.dispatchViewUpdates(-1);
public void updateRootLayoutSpecs(final int rootViewTag, final int widthMeasureSpec, final int heightMeasureSpec) {
ReactApplicationContext reactApplicationContext = getReactApplicationContext();
reactApplicationContext.runOnNativeModulesQueueThread(
new GuardedRunnable(reactApplicationContext) {
@Override
public void runGuarded() {
mUIImplementation.updateRootView(rootViewTag, widthMeasureSpec, heightMeasureSpec);
mUIImplementation.dispatchViewUpdates(-1);
}});
}
/** Listener that drops the CSSNode pool on low memory when the app is backgrounded. */