From 02e950d8dfb66b7869f92cdeb094035e8993e3ce Mon Sep 17 00:00:00 2001 From: Ruslan Shestopalyuk Date: Fri, 26 Jul 2024 09:22:31 -0700 Subject: [PATCH] Kotlinify react/animated interfaces Differential Revision: D60284765 --- packages/react-native/ReactAndroid/api/ReactAndroid.api | 8 ++++++++ ...odeValueListener.java => AnimatedNodeValueListener.kt} | 8 ++++---- ...bleConfig.java => AnimatedNodeWithUpdateableConfig.kt} | 8 ++++---- 3 files changed, 16 insertions(+), 8 deletions(-) rename packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/{AnimatedNodeValueListener.java => AnimatedNodeValueListener.kt} (50%) rename packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/{AnimatedNodeWithUpdateableConfig.java => AnimatedNodeWithUpdateableConfig.kt} (59%) diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index 1741440a9bc8fb..c0890cd56abf72 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -440,6 +440,14 @@ public abstract interface class com/facebook/react/ViewManagerOnDemandReactPacka public abstract fun getViewManagerNames (Lcom/facebook/react/bridge/ReactApplicationContext;)Ljava/util/Collection; } +public abstract interface class com/facebook/react/animated/AnimatedNodeValueListener { + public abstract fun onValueUpdate (D)V +} + +public abstract interface class com/facebook/react/animated/AnimatedNodeWithUpdateableConfig { + public abstract fun onUpdateConfig (Lcom/facebook/react/bridge/ReadableMap;)V +} + public class com/facebook/react/animated/NativeAnimatedModule : com/facebook/fbreact/specs/NativeAnimatedModuleSpec, com/facebook/react/bridge/LifecycleEventListener, com/facebook/react/bridge/UIManagerListener { public static final field ANIMATED_MODULE_DEBUG Z public fun (Lcom/facebook/react/bridge/ReactApplicationContext;)V diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNodeValueListener.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNodeValueListener.kt similarity index 50% rename from packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNodeValueListener.java rename to packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNodeValueListener.kt index 512fda12ad8025..234f1ce01a8d17 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNodeValueListener.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNodeValueListener.kt @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -package com.facebook.react.animated; +package com.facebook.react.animated -/** Interface used to listen to {@link ValueAnimatedNode} updates. */ -interface AnimatedNodeValueListener { - void onValueUpdate(double value); +/** Interface used to listen to [ValueAnimatedNode] updates. */ +public fun interface AnimatedNodeValueListener { + public fun onValueUpdate(value: Double) } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNodeWithUpdateableConfig.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNodeWithUpdateableConfig.kt similarity index 59% rename from packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNodeWithUpdateableConfig.java rename to packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNodeWithUpdateableConfig.kt index a8cf01e11f1456..bd5c8dff0a8de4 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNodeWithUpdateableConfig.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/AnimatedNodeWithUpdateableConfig.kt @@ -5,11 +5,11 @@ * LICENSE file in the root directory of this source tree. */ -package com.facebook.react.animated; +package com.facebook.react.animated -import com.facebook.react.bridge.ReadableMap; +import com.facebook.react.bridge.ReadableMap /** Indicates that AnimatedNode is able to receive native config updates. */ -interface AnimatedNodeWithUpdateableConfig { - void onUpdateConfig(ReadableMap config); +public fun interface AnimatedNodeWithUpdateableConfig { + public fun onUpdateConfig(config: ReadableMap?) }