Skip to content

Commit 6a07f59

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

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
@@ -7507,18 +7507,6 @@ public final class com/facebook/react/views/text/TextTransformKt {
75077507
public static final fun applyTextTransform (Ljava/lang/String;Lcom/facebook/react/views/text/TextTransform;)Ljava/lang/String;
75087508
}
75097509

7510-
public class com/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageViewManager : com/facebook/react/uimanager/BaseViewManager {
7511-
public static final field REACT_CLASS Ljava/lang/String;
7512-
public fun <init> ()V
7513-
public fun <init> (Lcom/facebook/drawee/controller/AbstractDraweeControllerBuilder;Ljava/lang/Object;)V
7514-
public synthetic fun createShadowNodeInstance ()Lcom/facebook/react/uimanager/ReactShadowNode;
7515-
public fun createShadowNodeInstance ()Lcom/facebook/react/views/text/frescosupport/FrescoBasedReactTextInlineImageShadowNode;
7516-
public fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
7517-
public fun getName ()Ljava/lang/String;
7518-
public fun getShadowNodeClass ()Ljava/lang/Class;
7519-
public fun updateExtraData (Landroid/view/View;Ljava/lang/Object;)V
7520-
}
7521-
75227510
public abstract interface class com/facebook/react/views/textinput/ContentSizeWatcher {
75237511
public abstract fun onLayout ()V
75247512
}

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)