Align ReadableMap and MapBuffer measure methods in ViewManager

Summary:
Aligns two codepaths for measure, making sure we can use both MapBuffer and ReadableMap for measuring components.

Changelog: [Internal] - Align measure interface for MapBuffer experiment

Reviewed By: javache, mdvacca

Differential Revision: D34960317

fbshipit-source-id: a39eb84a0abb4414717463f2f1741e470be3531f
This commit is contained in:
Andrei Shikov
2022-03-18 00:36:07 -07:00
committed by Facebook GitHub Bot
parent 5f2835b14d
commit d63bf4add3
5 changed files with 92 additions and 27 deletions
@@ -540,8 +540,9 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
private long measureMapBuffer(
int surfaceId,
String componentName,
ReadableMapBuffer attributedString,
ReadableMapBuffer paragraphAttributes,
ReadableMapBuffer localData,
ReadableMapBuffer props,
@Nullable ReadableMapBuffer state,
float minWidth,
float maxWidth,
float minHeight,
@@ -561,11 +562,12 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
}
// TODO: replace ReadableNativeMap -> ReadableMapBuffer
return mMountingManager.measureTextMapBuffer(
return mMountingManager.measureMapBuffer(
context,
componentName,
attributedString,
paragraphAttributes,
localData,
props,
state,
getYogaSize(minWidth, maxWidth),
getYogaMeasureMode(minWidth, maxWidth),
getYogaSize(minHeight, maxHeight),