mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
AndroidTextInput: support proper measuring of AndroidTextInput text, and displaying attributed strings
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
This commit is contained in:
committed by
Facebook Github Bot
parent
1cab7ad1d6
commit
07580f0f7e
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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
|
||||
Reference in New Issue
Block a user