Skip to content

Commit

Permalink
Migrate ReactUnimplementedViewManager to use ViewManagerInterface (#4…
Browse files Browse the repository at this point in the history
…7392)

Summary:

Migrate ReactUnimplementedViewManager to use ViewManagerInterface

changelog: [internal] internal

Differential Revision: D65428644
  • Loading branch information
mdvacca authored and facebook-github-bot committed Nov 4, 2024
1 parent df6ad98 commit 2343560
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
6 changes: 4 additions & 2 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -8166,13 +8166,15 @@ public final class com/facebook/react/views/unimplementedview/ReactUnimplemented
public final fun setName (Ljava/lang/String;)V
}

public final class com/facebook/react/views/unimplementedview/ReactUnimplementedViewManager : com/facebook/react/uimanager/ViewGroupManager {
public final class com/facebook/react/views/unimplementedview/ReactUnimplementedViewManager : com/facebook/react/uimanager/ViewGroupManager, com/facebook/react/viewmanagers/UnimplementedNativeViewManagerInterface {
public static final field Companion Lcom/facebook/react/views/unimplementedview/ReactUnimplementedViewManager$Companion;
public static final field REACT_CLASS Ljava/lang/String;
public fun <init> ()V
public synthetic fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
public fun getDelegate ()Lcom/facebook/react/uimanager/ViewManagerDelegate;
public fun getName ()Ljava/lang/String;
public final fun setName (Lcom/facebook/react/views/unimplementedview/ReactUnimplementedView;Ljava/lang/String;)V
public synthetic fun setName (Landroid/view/View;Ljava/lang/String;)V
public fun setName (Lcom/facebook/react/views/unimplementedview/ReactUnimplementedView;Ljava/lang/String;)V
}

public class com/facebook/react/views/unimplementedview/ReactUnimplementedViewManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,21 @@ package com.facebook.react.views.unimplementedview
import com.facebook.react.module.annotations.ReactModule
import com.facebook.react.uimanager.ThemedReactContext
import com.facebook.react.uimanager.ViewGroupManager
import com.facebook.react.uimanager.ViewManagerDelegate
import com.facebook.react.uimanager.annotations.ReactProp
import com.facebook.react.viewmanagers.UnimplementedNativeViewManagerDelegate
import com.facebook.react.viewmanagers.UnimplementedNativeViewManagerInterface

/** ViewManager for [ReactUnimplementedView] to represent a component that is not yet supported. */
@ReactModule(name = ReactUnimplementedViewManager.REACT_CLASS)
public class ReactUnimplementedViewManager : ViewGroupManager<ReactUnimplementedView>() {
public class ReactUnimplementedViewManager :
ViewGroupManager<ReactUnimplementedView>(),
UnimplementedNativeViewManagerInterface<ReactUnimplementedView> {

private val delegate: ViewManagerDelegate<ReactUnimplementedView> =
UnimplementedNativeViewManagerDelegate(this)

public override fun getDelegate(): ViewManagerDelegate<ReactUnimplementedView> = delegate

protected override fun createViewInstance(
reactContext: ThemedReactContext
Expand All @@ -23,8 +33,8 @@ public class ReactUnimplementedViewManager : ViewGroupManager<ReactUnimplemented
public override fun getName(): String = REACT_CLASS

@ReactProp(name = "name")
public fun setName(view: ReactUnimplementedView, name: String) {
view.setName(name)
public override fun setName(view: ReactUnimplementedView, name: String?): Unit {
view.setName(name ?: "<null component name>")
}

public companion object {
Expand Down

0 comments on commit 2343560

Please sign in to comment.