Unify measure functions in Fabric Android

Summary:
Until now, there were two measure functions that differ in only one parameter (rootTag). The rootTag is used to use the context associated to the tag as part of the calculation of layout, otherwise it just uses the ReactApplicationContext.
This diff unifies both method into an unique method that

changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D20081281

fbshipit-source-id: b1f6a6cedbf78f36f36fd0f93407c23c6996d76b
This commit is contained in:
David Vacca
2020-02-24 18:18:32 -08:00
committed by Facebook Github Bot
parent ed5f9eeb2a
commit 6aea6256a6
2 changed files with 5 additions and 24 deletions
@@ -429,31 +429,10 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
float maxWidth,
float minHeight,
float maxHeight) {
ReactContext context =
rootTag < 0 ? mReactApplicationContext : mReactContextForRootTag.get(rootTag);
return mMountingManager.measure(
mReactContextForRootTag.get(rootTag),
componentName,
localData,
props,
state,
getYogaSize(minWidth, maxWidth),
getYogaMeasureMode(minWidth, maxWidth),
getYogaSize(minHeight, maxHeight),
getYogaMeasureMode(minHeight, maxHeight));
}
@DoNotStrip
@SuppressWarnings("unused")
private long measure(
String componentName,
@NonNull ReadableMap localData,
@NonNull ReadableMap props,
@NonNull ReadableMap state,
float minWidth,
float maxWidth,
float minHeight,
float maxHeight) {
return mMountingManager.measure(
mReactApplicationContext,
context,
componentName,
localData,
props,