mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-27 22:24:38 +08:00
ReadableNativeMap -> ReadableMap
Summary: This diff refactors JNI methods used by the Binding.cpp class in order to use ReadableMap instead of ReadableNativeMap This will be helpful to provide a different implementation of ReadableMap from C++ Reviewed By: shergin Differential Revision: D14077762 fbshipit-source-id: 595b0c2d3a2d6070112257b65c1141a8af36f0e1
This commit is contained in:
committed by
Facebook Github Bot
parent
1ec9325bae
commit
959fdf6049
@@ -34,8 +34,8 @@ Size TextLayoutManager::measure(
|
||||
jni::findClassStatic("com/facebook/react/fabric/FabricUIManager")
|
||||
->getMethod<jlong(
|
||||
jstring,
|
||||
ReadableNativeMap::javaobject,
|
||||
ReadableNativeMap::javaobject,
|
||||
ReadableMap::javaobject,
|
||||
ReadableMap::javaobject,
|
||||
jint,
|
||||
jint,
|
||||
jint,
|
||||
@@ -47,12 +47,22 @@ Size TextLayoutManager::measure(
|
||||
int minHeight = (int)minimumSize.height;
|
||||
int maxWidth = (int)maximumSize.width;
|
||||
int maxHeight = (int)maximumSize.height;
|
||||
|
||||
local_ref<JString> componentName = make_jstring("RCTText");
|
||||
local_ref<ReadableNativeMap::javaobject> attributedStringRNM =
|
||||
ReadableNativeMap::newObjectCxxArgs(toDynamic(attributedString));
|
||||
local_ref<ReadableNativeMap::javaobject> paragraphAttributesRNM =
|
||||
ReadableNativeMap::newObjectCxxArgs(toDynamic(paragraphAttributes));
|
||||
|
||||
local_ref<ReadableMap::javaobject> attributedStringRM = make_local(
|
||||
reinterpret_cast<ReadableMap::javaobject>(attributedStringRNM.get()));
|
||||
local_ref<ReadableMap::javaobject> paragraphAttributesRM = make_local(
|
||||
reinterpret_cast<ReadableMap::javaobject>(paragraphAttributesRNM.get()));
|
||||
return yogaMeassureToSize(measure(
|
||||
fabricUIManager,
|
||||
componentName.get(),
|
||||
ReadableNativeMap::newObjectCxxArgs(toDynamic(attributedString)).get(),
|
||||
ReadableNativeMap::newObjectCxxArgs(toDynamic(paragraphAttributes)).get(),
|
||||
attributedStringRM.get(),
|
||||
paragraphAttributesRM.get(),
|
||||
minWidth,
|
||||
maxWidth,
|
||||
minHeight,
|
||||
|
||||
Reference in New Issue
Block a user