Skip to content

Commit d5f33c1

Browse files
alanleedevfacebook-github-bot
authored andcommitted
com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager.java (#47561)
Summary: Pull Request resolved: #47561 Convert Java to Kotlin Changelog: [Android][Breaking] changed visibility of FrescoBasedReactTextInlineImageViewManager to internal Reviewed By: javache Differential Revision: D65606954 fbshipit-source-id: bfdb5624a104029c8d667ddb9262c862ab846a61
1 parent 088fcb1 commit d5f33c1

File tree

3 files changed

+50
-82
lines changed

3 files changed

+50
-82
lines changed

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7520,18 +7520,6 @@ public final class com/facebook/react/views/text/TextTransformKt {
75207520
public static final fun applyTextTransform (Ljava/lang/String;Lcom/facebook/react/views/text/TextTransform;)Ljava/lang/String;
75217521
}
75227522

7523-
public class com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager : com/facebook/react/uimanager/BaseViewManager {
7524-
public static final field REACT_CLASS Ljava/lang/String;
7525-
public fun <init> ()V
7526-
public fun <init> (Lcom/facebook/drawee/controller/AbstractDraweeControllerBuilder;Ljava/lang/Object;)V
7527-
public synthetic fun createShadowNodeInstance ()Lcom/facebook/react/uimanager/ReactShadowNode;
7528-
public fun createShadowNodeInstance ()Lcom/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode;
7529-
public fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
7530-
public fun getName ()Ljava/lang/String;
7531-
public fun getShadowNodeClass ()Ljava/lang/Class;
7532-
public fun updateExtraData (Landroid/view/View;Ljava/lang/Object;)V
7533-
}
7534-
75357523
public abstract interface class com/facebook/react/views/textinput/ContentSizeWatcher {
75367524
public abstract fun onLayout ()V
75377525
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager.java

Lines changed: 0 additions & 70 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
package com.facebook.react.views.text.frescosupport
9+
10+
import android.view.View
11+
import com.facebook.drawee.backends.pipeline.Fresco
12+
import com.facebook.drawee.controller.AbstractDraweeControllerBuilder
13+
import com.facebook.react.module.annotations.ReactModule
14+
import com.facebook.react.uimanager.BaseViewManager
15+
import com.facebook.react.uimanager.ThemedReactContext
16+
17+
/**
18+
* Manages Images embedded in Text nodes using Fresco. Since they are used only as a virtual nodes
19+
* any type of native view operation will throw an [IllegalStateException].
20+
*/
21+
@ReactModule(name = FrescoBasedReactTextInlineImageViewManager.REACT_CLASS)
22+
internal class FrescoBasedReactTextInlineImageViewManager
23+
@JvmOverloads
24+
constructor(
25+
private val draweeControllerBuilder:
26+
@JvmSuppressWildcards
27+
AbstractDraweeControllerBuilder<*, *, *, *>? =
28+
null,
29+
private val callerContext: Any? = null
30+
) : BaseViewManager<View, FrescoBasedReactTextInlineImageShadowNode>() {
31+
32+
override fun getName(): String = REACT_CLASS
33+
34+
public override fun createViewInstance(context: ThemedReactContext): View {
35+
throw IllegalStateException("RCTTextInlineImage doesn't map into a native view")
36+
}
37+
38+
override fun createShadowNodeInstance(): FrescoBasedReactTextInlineImageShadowNode =
39+
FrescoBasedReactTextInlineImageShadowNode(
40+
draweeControllerBuilder ?: Fresco.newDraweeControllerBuilder(), callerContext)
41+
42+
override fun getShadowNodeClass(): Class<FrescoBasedReactTextInlineImageShadowNode> =
43+
FrescoBasedReactTextInlineImageShadowNode::class.java
44+
45+
override fun updateExtraData(root: View, extraData: Any) = Unit
46+
47+
public companion object {
48+
public const val REACT_CLASS: String = "RCTTextInlineImage"
49+
}
50+
}

0 commit comments

Comments
 (0)