mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
07580f0f7e
Summary: Use a similar setup as Paragraph, and support in Fabric: - Correct measuring of AndroidTextInput - Correct display of AndroidTextInput attributed strings Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D18669957 fbshipit-source-id: 84e0ad8021c9edf8219e0c673c781276ca29787d
28 lines
757 B
C++
28 lines
757 B
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 "AndroidTextInputState.h"
|
|
|
|
#include <react/components/text/conversions.h>
|
|
#include <react/debug/debugStringConvertibleUtils.h>
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
#ifdef ANDROID
|
|
folly::dynamic AndroidTextInputState::getDynamic() const {
|
|
folly::dynamic newState = folly::dynamic::object();
|
|
newState["attributedString"] = toDynamic(attributedString);
|
|
newState["paragraphAttributes"] = toDynamic(paragraphAttributes);
|
|
newState["hash"] = newState["attributedString"]["hash"];
|
|
return newState;
|
|
}
|
|
#endif
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|