From 43f6d51dcd2ab06bb00093baaa30d98d2ca657be Mon Sep 17 00:00:00 2001 From: Ruslan Shestopalyuk Date: Tue, 12 Mar 2024 10:27:00 -0700 Subject: [PATCH] Add missing dependency from AndroidTextInput (#43448) Summary: ## Changelog: [Internal] - This adds a stub for `TextLayoutManager.measureCachedSpannableById`, as well as a missing explicit dependency to `jni/react/jni` from the `TextInput` implementation on the Android platform. This is required in order for certain build configurations to compile. Differential Revision: D54807518 --- .../textlayoutmanager/platform/cxx/TextLayoutManager.cpp | 7 +++++++ .../textlayoutmanager/platform/cxx/TextLayoutManager.h | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/TextLayoutManager.cpp b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/TextLayoutManager.cpp index 6d99a35008fc..b3e49dfed3a8 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/TextLayoutManager.cpp +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/TextLayoutManager.cpp @@ -29,6 +29,13 @@ TextMeasurement TextLayoutManager::measure( return TextMeasurement{{0, 0}, attachments}; } +TextMeasurement TextLayoutManager::measureCachedSpannableById( + int64_t /*cacheId*/, + const ParagraphAttributes& /*paragraphAttributes*/, + LayoutConstraints /*layoutConstraints*/) const { + return {}; +} + LinesMeasurements TextLayoutManager::measureLines( AttributedString attributedString, ParagraphAttributes paragraphAttributes, diff --git a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/TextLayoutManager.h b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/TextLayoutManager.h index 63903786a91b..0d323241190f 100644 --- a/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/TextLayoutManager.h +++ b/packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/cxx/TextLayoutManager.h @@ -42,6 +42,15 @@ class TextLayoutManager { LayoutConstraints layoutConstraints, std::shared_ptr) const; + /** + * Measures an AttributedString on the platform, as identified by some + * opaque cache ID. + */ + virtual TextMeasurement measureCachedSpannableById( + int64_t cacheId, + const ParagraphAttributes& paragraphAttributes, + LayoutConstraints layoutConstraints) const; + /* * Measures lines of `attributedString` using native text rendering * infrastructure.