void MethodCreator::load_locals(DexMethod* meth) { if (!(access & ACC_STATIC)) { make_local(meth->get_class()); } auto proto = meth->get_proto(); auto args = proto->get_args(); if (args) { for (auto arg : args->get_type_list()) { make_local(arg); } } }
Size TextLayoutManager::measure( AttributedString attributedString, ParagraphAttributes paragraphAttributes, LayoutConstraints layoutConstraints) const { const jni::global_ref<jobject> &fabricUIManager = contextContainer_->getInstance<jni::global_ref<jobject>>( "FabricUIManager"); static auto measure = jni::findClassStatic("com/facebook/react/fabric/FabricUIManager") ->getMethod<jlong( jstring, ReadableMap::javaobject, ReadableMap::javaobject, jint, jint, jint, jint)>("measure"); auto minimumSize = layoutConstraints.minimumSize; auto maximumSize = layoutConstraints.maximumSize; int minWidth = (int)minimumSize.width; 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(), attributedStringRM.get(), paragraphAttributesRM.get(), minWidth, maxWidth, minHeight, maxHeight)); }