Skip to content

Commit

Permalink
Migrate ReactVirtualTextViewManager to kotlin and reduce visibility t…
Browse files Browse the repository at this point in the history
…ointernal (facebook#47402)

Summary:
Pull Request resolved: facebook#47402

Migrate ReactVirtualTextViewManager to kotlin and reduce visibility tointernal

changelog: [Android][Breaking] Reduce visibility of ReactVirtualTextViewManager to internal

Differential Revision: D65462051
  • Loading branch information
mdvacca committed Nov 5, 2024
1 parent 0e7ba90 commit 17ec017
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 76 deletions.
29 changes: 0 additions & 29 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -7740,35 +7740,6 @@ public class com/facebook/react/views/text/ReactTypefaceUtils {
public static fun parseFontWeight (Ljava/lang/String;)I
}

public class com/facebook/react/views/text/ReactVirtualTextShadowNode : com/facebook/react/views/text/ReactBaseTextShadowNode {
public fun <init> ()V
public fun isVirtual ()Z
}

public class com/facebook/react/views/text/ReactVirtualTextShadowNode$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ShadowNodeSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ReactShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/ReactVirtualTextShadowNode;Ljava/lang/String;Ljava/lang/Object;)V
}

public class com/facebook/react/views/text/ReactVirtualTextViewManager : com/facebook/react/uimanager/BaseViewManager {
public fun <init> ()V
public synthetic fun createShadowNodeInstance ()Lcom/facebook/react/uimanager/ReactShadowNode;
public fun createShadowNodeInstance ()Lcom/facebook/react/views/text/ReactVirtualTextShadowNode;
public fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
public fun getName ()Ljava/lang/String;
public fun getShadowNodeClass ()Ljava/lang/Class;
public fun updateExtraData (Landroid/view/View;Ljava/lang/Object;)V
}

public class com/facebook/react/views/text/ReactVirtualTextViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
public fun <init> ()V
public fun getProperties (Ljava/util/Map;)V
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
public fun setProperty (Lcom/facebook/react/views/text/ReactVirtualTextViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}

public class com/facebook/react/views/text/TextAttributeProps {
public static final field TA_KEY_ACCESSIBILITY_ROLE S
public static final field TA_KEY_ALIGNMENT S
Expand Down
2 changes: 2 additions & 0 deletions packages/react-native/ReactAndroid/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ react.internal.disableJavaVersionAlignment=true

# Binary Compatibility Validator properties
binaryCompatibilityValidator.ignoredClasses=com.facebook.react.BuildConfig,\
com.facebook.react.views.text.ReactVirtualTextShadowNode$$PropsSetter,\
com.facebook.react.views.text.ReactVirtualTextViewManager$$PropsSetter,\
com.facebook.react.views.unimplementedview.ReactUnimplementedViewManager$$PropsSetter

binaryCompatibilityValidator.ignoredPackages=com.facebook.debug,\
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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

import android.view.View
import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.uimanager.BaseViewManager
import com.facebook.react.uimanager.ThemedReactContext

/**
* Manages raw text nodes. Since they are used only as a virtual nodes any type of native view
* operation will throw an [IllegalStateException]
*/
@ReactModule(name = ReactVirtualTextViewManager.REACT_CLASS)
internal class ReactVirtualTextViewManager : BaseViewManager<View, ReactVirtualTextShadowNode>() {

public override fun getName(): String = REACT_CLASS

protected override fun createViewInstance(context: ThemedReactContext): View {
throw IllegalStateException("Attempt to create a native view for RCTVirtualText")
}

public override fun updateExtraData(view: View, extraData: Any): Unit {}

public override fun getShadowNodeClass(): Class<ReactVirtualTextShadowNode> =
ReactVirtualTextShadowNode::class.java

override fun createShadowNodeInstance(): ReactVirtualTextShadowNode = ReactVirtualTextShadowNode()

internal companion object {
public const val REACT_CLASS: String = "RCTVirtualText"
}
}

0 comments on commit 17ec017

Please sign in to comment.