Skip to content

Commit

Permalink
Refactor ViewManager codegen to use new ViewManagerInterface
Browse files Browse the repository at this point in the history
Summary:
Refactor ViewManager codegen to use new ViewManagerInterface

changelog: [internal] internal

Differential Revision: D67957884
  • Loading branch information
mdvacca authored and facebook-github-bot committed Jan 9, 2025
1 parent 9f7660f commit 3e59f22
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ package ${packageName};
${imports}
public interface ${className}<T extends ${extendClasses}> {
public interface ${className}<T extends ${extendClasses}> extends ViewManagerInterface<T> {
${methods}
}
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ function getImports(
): Set<string> {
const imports: Set<string> = new Set();

if (type === 'interface') {
imports.add('import com.facebook.react.uimanager.ViewManagerInterface;');
}

component.extendsProps.forEach(extendProps => {
switch (extendProps.type) {
case 'ReactNativeBuiltInType':
Expand Down
20 changes: 10 additions & 10 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -6071,7 +6071,7 @@ public class com/facebook/react/viewmanagers/ActivityIndicatorViewManagerDelegat
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}

public abstract interface class com/facebook/react/viewmanagers/ActivityIndicatorViewManagerInterface {
public abstract interface class com/facebook/react/viewmanagers/ActivityIndicatorViewManagerInterface : com/facebook/react/uimanager/ViewManagerInterface {
public abstract fun setAnimating (Landroid/view/View;Z)V
public abstract fun setColor (Landroid/view/View;Ljava/lang/Integer;)V
public abstract fun setHidesWhenStopped (Landroid/view/View;Z)V
Expand All @@ -6084,7 +6084,7 @@ public class com/facebook/react/viewmanagers/AndroidDrawerLayoutManagerDelegate
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}

public abstract interface class com/facebook/react/viewmanagers/AndroidDrawerLayoutManagerInterface {
public abstract interface class com/facebook/react/viewmanagers/AndroidDrawerLayoutManagerInterface : com/facebook/react/uimanager/ViewManagerInterface {
public abstract fun closeDrawer (Landroid/view/View;)V
public abstract fun openDrawer (Landroid/view/View;)V
public abstract fun setDrawerBackgroundColor (Landroid/view/View;Ljava/lang/Integer;)V
Expand All @@ -6100,7 +6100,7 @@ public class com/facebook/react/viewmanagers/AndroidHorizontalScrollContentViewM
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}

public abstract interface class com/facebook/react/viewmanagers/AndroidHorizontalScrollContentViewManagerInterface {
public abstract interface class com/facebook/react/viewmanagers/AndroidHorizontalScrollContentViewManagerInterface : com/facebook/react/uimanager/ViewManagerInterface {
public abstract fun setRemoveClippedSubviews (Landroid/view/View;Z)V
}

Expand All @@ -6109,7 +6109,7 @@ public class com/facebook/react/viewmanagers/AndroidProgressBarManagerDelegate :
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}

public abstract interface class com/facebook/react/viewmanagers/AndroidProgressBarManagerInterface {
public abstract interface class com/facebook/react/viewmanagers/AndroidProgressBarManagerInterface : com/facebook/react/uimanager/ViewManagerInterface {
public abstract fun setAnimating (Landroid/view/View;Z)V
public abstract fun setColor (Landroid/view/View;Ljava/lang/Integer;)V
public abstract fun setIndeterminate (Landroid/view/View;Z)V
Expand All @@ -6125,7 +6125,7 @@ public class com/facebook/react/viewmanagers/AndroidSwipeRefreshLayoutManagerDel
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}

public abstract interface class com/facebook/react/viewmanagers/AndroidSwipeRefreshLayoutManagerInterface {
public abstract interface class com/facebook/react/viewmanagers/AndroidSwipeRefreshLayoutManagerInterface : com/facebook/react/uimanager/ViewManagerInterface {
public abstract fun setColors (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
public abstract fun setEnabled (Landroid/view/View;Z)V
public abstract fun setNativeRefreshing (Landroid/view/View;Z)V
Expand All @@ -6141,7 +6141,7 @@ public class com/facebook/react/viewmanagers/AndroidSwitchManagerDelegate : com/
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}

public abstract interface class com/facebook/react/viewmanagers/AndroidSwitchManagerInterface {
public abstract interface class com/facebook/react/viewmanagers/AndroidSwitchManagerInterface : com/facebook/react/uimanager/ViewManagerInterface {
public abstract fun setDisabled (Landroid/view/View;Z)V
public abstract fun setEnabled (Landroid/view/View;Z)V
public abstract fun setNativeValue (Landroid/view/View;Z)V
Expand All @@ -6160,7 +6160,7 @@ public class com/facebook/react/viewmanagers/DebuggingOverlayManagerDelegate : c
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}

public abstract interface class com/facebook/react/viewmanagers/DebuggingOverlayManagerInterface {
public abstract interface class com/facebook/react/viewmanagers/DebuggingOverlayManagerInterface : com/facebook/react/uimanager/ViewManagerInterface {
public abstract fun clearElementsHighlights (Landroid/view/View;)V
public abstract fun highlightElements (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
public abstract fun highlightTraceUpdates (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
Expand All @@ -6171,7 +6171,7 @@ public class com/facebook/react/viewmanagers/ModalHostViewManagerDelegate : com/
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}

public abstract interface class com/facebook/react/viewmanagers/ModalHostViewManagerInterface {
public abstract interface class com/facebook/react/viewmanagers/ModalHostViewManagerInterface : com/facebook/react/uimanager/ViewManagerInterface {
public abstract fun setAnimated (Landroid/view/View;Z)V
public abstract fun setAnimationType (Landroid/view/View;Ljava/lang/String;)V
public abstract fun setHardwareAccelerated (Landroid/view/View;Z)V
Expand All @@ -6189,15 +6189,15 @@ public class com/facebook/react/viewmanagers/SafeAreaViewManagerDelegate : com/f
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}

public abstract interface class com/facebook/react/viewmanagers/SafeAreaViewManagerInterface {
public abstract interface class com/facebook/react/viewmanagers/SafeAreaViewManagerInterface : com/facebook/react/uimanager/ViewManagerInterface {
}

public class com/facebook/react/viewmanagers/UnimplementedNativeViewManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManager;)V
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
}

public abstract interface class com/facebook/react/viewmanagers/UnimplementedNativeViewManagerInterface {
public abstract interface class com/facebook/react/viewmanagers/UnimplementedNativeViewManagerInterface : com/facebook/react/uimanager/ViewManagerInterface {
public abstract fun setName (Landroid/view/View;Ljava/lang/String;)V
}

Expand Down

0 comments on commit 3e59f22

Please sign in to comment.