Implement Local Data in Android Fabric C++

Summary: This diff introduces the concept of Local Data in Android Fabric C++ and as an example we uses it to implement Text View.

Reviewed By: shergin

Differential Revision: D9583970

fbshipit-source-id: ab7478b16ef4327ff574ca1467870ab9cb684ea0
This commit is contained in:
David Vacca
2018-09-17 18:46:08 -07:00
committed by Facebook Github Bot
parent 5c0da011cb
commit 9ad193c35b
7 changed files with 58 additions and 5 deletions

View File

@@ -7,6 +7,7 @@
#include "TextLayoutManager.h"
#include <fabric/attributedstring/conversions.h>
#include <react/jni/ReadableNativeMap.h>
using namespace facebook::jni;
@@ -37,7 +38,7 @@ Size TextLayoutManager::measure(
int width = (int) layoutConstraints.maximumSize.width;
int height = (int) layoutConstraints.maximumSize.height;
local_ref<JString> componentName = make_jstring("RCTText");
auto values = measure(fabricUIManager, reactTag, componentName.get(), ReadableNativeMap::newObjectCxxArgs(attributedString.toDynamic()).get(), ReadableNativeMap::newObjectCxxArgs(paragraphAttributes.toDynamic()).get(), width, height);
auto values = measure(fabricUIManager, reactTag, componentName.get(), ReadableNativeMap::newObjectCxxArgs(toDynamic(attributedString)).get(), ReadableNativeMap::newObjectCxxArgs(toDynamic(paragraphAttributes)).get(), width, height);
std::vector<float> indices;
indices.resize(values->size());