mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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
52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#include "ParagraphLocalData.h"
|
|
|
|
#include <fabric/components/text/conversions.h>
|
|
#include <fabric/debug/debugStringConvertibleUtils.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
AttributedString ParagraphLocalData::getAttributedString() const {
|
|
return attributedString_;
|
|
}
|
|
|
|
void ParagraphLocalData::setAttributedString(AttributedString attributedString) {
|
|
ensureUnsealed();
|
|
attributedString_ = attributedString;
|
|
}
|
|
|
|
SharedTextLayoutManager ParagraphLocalData::getTextLayoutManager() const {
|
|
return textLayoutManager_;
|
|
}
|
|
|
|
void ParagraphLocalData::setTextLayoutManager(SharedTextLayoutManager textLayoutManager) {
|
|
ensureUnsealed();
|
|
textLayoutManager_ = textLayoutManager;
|
|
}
|
|
|
|
folly::dynamic ParagraphLocalData::getDynamic() const {
|
|
return toDynamic(*this);
|
|
}
|
|
|
|
#pragma mark - DebugStringConvertible
|
|
|
|
std::string ParagraphLocalData::getDebugName() const {
|
|
return "ParagraphLocalData";
|
|
}
|
|
|
|
SharedDebugStringConvertibleList ParagraphLocalData::getDebugProps() const {
|
|
return {
|
|
debugStringConvertibleItem("attributedString", attributedString_, "")
|
|
};
|
|
}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|