From bca791a09e69a4ee855d228ad0a67cd453a3e117 Mon Sep 17 00:00:00 2001 From: Thomas Nardone Date: Thu, 9 Jan 2025 14:32:49 -0800 Subject: [PATCH] Convert ReactTextInlineImageShadowNode (#48576) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48576 Changelog: [Internal] Reviewed By: cortinico Differential Revision: D67981753 --- .../ReactTextInlineImageShadowNode.java | 24 ------------------- .../ReactTextInlineImageShadowNode.kt | 21 ++++++++++++++++ 2 files changed, 21 insertions(+), 24 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/ReactTextInlineImageShadowNode.java create mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/ReactTextInlineImageShadowNode.kt diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/ReactTextInlineImageShadowNode.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/ReactTextInlineImageShadowNode.java deleted file mode 100644 index dbb409dc06b8ce..00000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/ReactTextInlineImageShadowNode.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -package com.facebook.react.views.text.internal; - -import com.facebook.react.uimanager.LayoutShadowNode; -import com.facebook.react.views.text.internal.span.TextInlineImageSpan; -import com.facebook.yoga.YogaNode; - -/** Base class for {@link YogaNode}s that represent inline images. */ -public abstract class ReactTextInlineImageShadowNode extends LayoutShadowNode { - - /** - * Build a {@link TextInlineImageSpan} from this node. This will be added to the TextView in place - * of this node. - */ - public abstract TextInlineImageSpan buildInlineImageSpan(); - - public ReactTextInlineImageShadowNode() {} -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/ReactTextInlineImageShadowNode.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/ReactTextInlineImageShadowNode.kt new file mode 100644 index 00000000000000..923bdf87f75747 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/internal/ReactTextInlineImageShadowNode.kt @@ -0,0 +1,21 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package com.facebook.react.views.text.internal + +import com.facebook.react.uimanager.LayoutShadowNode +import com.facebook.react.views.text.internal.span.TextInlineImageSpan +import com.facebook.yoga.YogaNode + +/** Base class for [YogaNode]s that represent inline images. */ +internal abstract class ReactTextInlineImageShadowNode : LayoutShadowNode() { + /** + * Build a [TextInlineImageSpan] from this node. This will be added to the TextView in place of + * this node. + */ + public abstract fun buildInlineImageSpan(): TextInlineImageSpan +}