Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 22 additions & 18 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -1372,8 +1372,8 @@ public abstract interface class com/facebook/react/bridge/UIManager : com/facebo
public abstract fun initialize ()V
public abstract fun invalidate ()V
public abstract fun markActiveTouchForTag (II)V
public abstract fun receiveEvent (IILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
public abstract fun receiveEvent (ILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
public abstract fun receiveEvent (IILjava/lang/String;Lcom/facebook/react/bridge/ReadableMap;)V
public abstract fun receiveEvent (ILjava/lang/String;Lcom/facebook/react/bridge/ReadableMap;)V
public abstract fun removeUIManagerEventListener (Lcom/facebook/react/bridge/UIManagerListener;)V
public abstract fun resolveCustomDirectEventName (Ljava/lang/String;)Ljava/lang/String;
public abstract fun resolveView (I)Landroid/view/View;
Expand Down Expand Up @@ -2275,11 +2275,11 @@ public class com/facebook/react/fabric/FabricUIManager : com/facebook/react/brid
public fun onRequestEventBeat ()V
public fun prependUIBlock (Lcom/facebook/react/fabric/interop/UIBlock;)V
public fun profileNextBatch ()V
public fun receiveEvent (IILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
public fun receiveEvent (IILjava/lang/String;ZLcom/facebook/react/bridge/WritableMap;I)V
public fun receiveEvent (IILjava/lang/String;ZLcom/facebook/react/bridge/WritableMap;IZ)V
public fun receiveEvent (IILjava/lang/String;ZLcom/facebook/react/bridge/WritableMap;IZJ)V
public fun receiveEvent (ILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
public fun receiveEvent (IILjava/lang/String;Lcom/facebook/react/bridge/ReadableMap;)V
public fun receiveEvent (IILjava/lang/String;ZLcom/facebook/react/bridge/ReadableMap;I)V
public fun receiveEvent (IILjava/lang/String;ZLcom/facebook/react/bridge/ReadableMap;IZ)V
public fun receiveEvent (IILjava/lang/String;ZLcom/facebook/react/bridge/ReadableMap;IZJ)V
public fun receiveEvent (ILjava/lang/String;Lcom/facebook/react/bridge/ReadableMap;)V
public fun removeUIManagerEventListener (Lcom/facebook/react/bridge/UIManagerListener;)V
public fun resolveCustomDirectEventName (Ljava/lang/String;)Ljava/lang/String;
public fun resolveView (I)Landroid/view/View;
Expand Down Expand Up @@ -3503,6 +3503,7 @@ public final class com/facebook/react/uimanager/NativeViewHierarchyOptimizer {

public final class com/facebook/react/uimanager/OnLayoutEvent : com/facebook/react/uimanager/events/Event {
public static final field Companion Lcom/facebook/react/uimanager/OnLayoutEvent$Companion;
public synthetic fun getEventData ()Lcom/facebook/react/bridge/ReadableMap;
public fun getEventName ()Ljava/lang/String;
public static final fun obtain (IIIII)Lcom/facebook/react/uimanager/OnLayoutEvent;
public static final fun obtain (IIIIII)Lcom/facebook/react/uimanager/OnLayoutEvent;
Expand Down Expand Up @@ -4275,8 +4276,8 @@ public class com/facebook/react/uimanager/UIManagerModule : com/facebook/react/b
public fun onHostResume ()V
public fun prependUIBlock (Lcom/facebook/react/uimanager/UIBlock;)V
public fun profileNextBatch ()V
public fun receiveEvent (IILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
public fun receiveEvent (ILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
public fun receiveEvent (IILjava/lang/String;Lcom/facebook/react/bridge/ReadableMap;)V
public fun receiveEvent (ILjava/lang/String;Lcom/facebook/react/bridge/ReadableMap;)V
public fun removeRootView (I)V
public fun removeUIManagerEventListener (Lcom/facebook/react/bridge/UIManagerListener;)V
public fun resolveCustomDirectEventName (Ljava/lang/String;)Ljava/lang/String;
Expand Down Expand Up @@ -4679,6 +4680,7 @@ public abstract interface class com/facebook/react/uimanager/events/BatchEventDi
public final class com/facebook/react/uimanager/events/ContentSizeChangeEvent : com/facebook/react/uimanager/events/Event {
public fun <init> (III)V
public fun <init> (IIII)V
public synthetic fun getEventData ()Lcom/facebook/react/bridge/ReadableMap;
public fun getEventName ()Ljava/lang/String;
}

Expand All @@ -4695,7 +4697,7 @@ public abstract class com/facebook/react/uimanager/events/Event {
public fun getCoalescingKey ()S
public fun getEventAnimationDriverMatchSpec ()Lcom/facebook/react/uimanager/events/Event$EventAnimationDriverMatchSpec;
protected fun getEventCategory ()I
protected fun getEventData ()Lcom/facebook/react/bridge/WritableMap;
protected fun getEventData ()Lcom/facebook/react/bridge/ReadableMap;
public abstract fun getEventName ()Ljava/lang/String;
public final fun getSurfaceId ()I
public final fun getTimestampMs ()J
Expand Down Expand Up @@ -4734,7 +4736,7 @@ public final class com/facebook/react/uimanager/events/NativeGestureUtil {
}

public abstract interface class com/facebook/react/uimanager/events/RCTEventEmitter : com/facebook/react/bridge/JavaScriptModule {
public abstract fun receiveEvent (ILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
public abstract fun receiveEvent (ILjava/lang/String;Lcom/facebook/react/bridge/ReadableMap;)V
public fun receiveTouches (Ljava/lang/String;Lcom/facebook/react/bridge/WritableArray;Lcom/facebook/react/bridge/WritableArray;)V
}

Expand All @@ -4743,16 +4745,16 @@ public final class com/facebook/react/uimanager/events/RCTEventEmitter$DefaultIm
}

public abstract interface class com/facebook/react/uimanager/events/RCTModernEventEmitter : com/facebook/react/uimanager/events/RCTEventEmitter {
public fun receiveEvent (IILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
public abstract fun receiveEvent (IILjava/lang/String;ZILcom/facebook/react/bridge/WritableMap;I)V
public fun receiveEvent (IILjava/lang/String;ZILcom/facebook/react/bridge/WritableMap;IJ)V
public fun receiveEvent (ILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
public fun receiveEvent (IILjava/lang/String;Lcom/facebook/react/bridge/ReadableMap;)V
public abstract fun receiveEvent (IILjava/lang/String;ZILcom/facebook/react/bridge/ReadableMap;I)V
public fun receiveEvent (IILjava/lang/String;ZILcom/facebook/react/bridge/ReadableMap;IJ)V
public fun receiveEvent (ILjava/lang/String;Lcom/facebook/react/bridge/ReadableMap;)V
}

public final class com/facebook/react/uimanager/events/RCTModernEventEmitter$DefaultImpls {
public static fun receiveEvent (Lcom/facebook/react/uimanager/events/RCTModernEventEmitter;IILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
public static fun receiveEvent (Lcom/facebook/react/uimanager/events/RCTModernEventEmitter;IILjava/lang/String;ZILcom/facebook/react/bridge/WritableMap;IJ)V
public static fun receiveEvent (Lcom/facebook/react/uimanager/events/RCTModernEventEmitter;ILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
public static fun receiveEvent (Lcom/facebook/react/uimanager/events/RCTModernEventEmitter;IILjava/lang/String;Lcom/facebook/react/bridge/ReadableMap;)V
public static fun receiveEvent (Lcom/facebook/react/uimanager/events/RCTModernEventEmitter;IILjava/lang/String;ZILcom/facebook/react/bridge/ReadableMap;IJ)V
public static fun receiveEvent (Lcom/facebook/react/uimanager/events/RCTModernEventEmitter;ILjava/lang/String;Lcom/facebook/react/bridge/ReadableMap;)V
public static fun receiveTouches (Lcom/facebook/react/uimanager/events/RCTModernEventEmitter;Ljava/lang/String;Lcom/facebook/react/bridge/WritableArray;Lcom/facebook/react/bridge/WritableArray;)V
}

Expand Down Expand Up @@ -5238,6 +5240,7 @@ public final class com/facebook/react/views/image/ImageLoadEvent : com/facebook/
public static final fun createProgressEvent (ILjava/lang/String;II)Lcom/facebook/react/views/image/ImageLoadEvent;
public static final fun eventNameForType (I)Ljava/lang/String;
public fun getCoalescingKey ()S
public synthetic fun getEventData ()Lcom/facebook/react/bridge/ReadableMap;
public fun getEventName ()Ljava/lang/String;
}

Expand Down Expand Up @@ -5924,6 +5927,7 @@ public final class com/facebook/react/views/scroll/ReactScrollViewManager$Compan
public final class com/facebook/react/views/scroll/ScrollEvent : com/facebook/react/uimanager/events/Event {
public static final field Companion Lcom/facebook/react/views/scroll/ScrollEvent$Companion;
public fun canCoalesce ()Z
public synthetic fun getEventData ()Lcom/facebook/react/bridge/ReadableMap;
public fun getEventName ()Ljava/lang/String;
public static final fun obtain (IILcom/facebook/react/views/scroll/ScrollEventType;FFFFIIII)Lcom/facebook/react/views/scroll/ScrollEvent;
public static final fun obtain (ILcom/facebook/react/views/scroll/ScrollEventType;FFFFIIII)Lcom/facebook/react/views/scroll/ScrollEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import com.facebook.react.bridge.ReadableArray
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.bridge.ReadableType
import com.facebook.react.bridge.UnexpectedNativeTypeException
import com.facebook.react.bridge.WritableMap
import com.facebook.react.uimanager.events.EventCategoryDef
import com.facebook.react.uimanager.events.RCTModernEventEmitter

Expand All @@ -29,7 +28,7 @@ internal class EventAnimationDriver(
eventName: String,
canCoalesceEvent: Boolean,
customCoalesceKey: Int,
params: WritableMap?,
params: ReadableMap?,
@EventCategoryDef category: Int,
) {
requireNotNull(params) { "Native animated events must have event data." }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public interface UIManager : PerformanceCounter {
@ThreadConfined(ThreadConfined.UI)
@Deprecated(
"This legacy surface API will be removed in a future release. " +
"Use ReactHost.createSurface(...) and ReactSurface.start() instead."
"Use ReactHost.createSurface(...) and ReactSurface.start() instead.",
)
public fun <T : View> addRootView(rootView: T, initialProps: WritableMap?): Int

Expand All @@ -37,7 +37,7 @@ public interface UIManager : PerformanceCounter {
@AnyThread
@Deprecated(
"This legacy surface API will be removed in a future release. " +
"Use ReactHost.createSurface(...) and ReactSurface.start() instead."
"Use ReactHost.createSurface(...) and ReactSurface.start() instead.",
)
public fun <T : View?> startSurface(
rootView: T,
Expand All @@ -55,7 +55,7 @@ public interface UIManager : PerformanceCounter {
*/
@AnyThread
@Deprecated(
"This legacy surface API will be removed in a future release. Use ReactSurface.stop() instead."
"This legacy surface API will be removed in a future release. Use ReactSurface.stop() instead.",
)
public fun stopSurface(surfaceId: Int)

Expand Down Expand Up @@ -156,10 +156,11 @@ public interface UIManager : PerformanceCounter {
*
* @param reactTag tag
* @param eventName name of the event
* @param event parameters
* @param event native-backed event parameters; Fabric consumes the payload during dispatch, so it
* must not be reused afterwards
*/
@Deprecated("", ReplaceWith("receiveEvent(surfaceId, reactTag, eventName, event)"))
public fun receiveEvent(reactTag: Int, eventName: String, event: WritableMap?)
public fun receiveEvent(reactTag: Int, eventName: String, event: ReadableMap?)

/**
* This method dispatches events from RN Android code to JS. The delivery of this event will not
Expand All @@ -168,9 +169,10 @@ public interface UIManager : PerformanceCounter {
* @param surfaceId
* @param reactTag tag
* @param eventName name of the event
* @param event parameters
* @param event native-backed event parameters; Fabric consumes the payload during dispatch, so it
* must not be reused afterwards
*/
public fun receiveEvent(surfaceId: Int, reactTag: Int, eventName: String, event: WritableMap?)
public fun receiveEvent(surfaceId: Int, reactTag: Int, eventName: String, event: ReadableMap?)

/** Resolves Direct Event name exposed to JS from the one known to the Native side. */
@Deprecated("") public fun resolveCustomDirectEventName(eventName: String): String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1180,14 +1180,14 @@ public void updateRootLayoutSpecs(

@Deprecated
@Override
public void receiveEvent(int reactTag, String eventName, @Nullable WritableMap params) {
public void receiveEvent(int reactTag, String eventName, @Nullable ReadableMap params) {
receiveEvent(View.NO_ID, reactTag, eventName, false, params, EventCategoryDef.UNSPECIFIED);
}

@Deprecated
@Override
public void receiveEvent(
int surfaceId, int reactTag, String eventName, @Nullable WritableMap params) {
int surfaceId, int reactTag, String eventName, @Nullable ReadableMap params) {
receiveEvent(surfaceId, reactTag, eventName, false, params, EventCategoryDef.UNSPECIFIED);
}

Expand All @@ -1212,7 +1212,7 @@ public void receiveEvent(
int reactTag,
String eventName,
boolean canCoalesceEvent,
@Nullable WritableMap params,
@Nullable ReadableMap params,
@EventCategoryDef int eventCategory) {
receiveEvent(
surfaceId,
Expand Down Expand Up @@ -1248,7 +1248,7 @@ public void receiveEvent(
int reactTag,
String eventName,
boolean canCoalesceEvent,
@Nullable WritableMap params,
@Nullable ReadableMap params,
@EventCategoryDef int eventCategory,
boolean experimentalIsSynchronous) {
receiveEvent(
Expand Down Expand Up @@ -1284,7 +1284,7 @@ public void receiveEvent(
int reactTag,
String eventName,
boolean canCoalesceEvent,
@Nullable WritableMap params,
@Nullable ReadableMap params,
@EventCategoryDef int eventCategory,
boolean experimentalIsSynchronous,
long eventTimestamp) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import android.annotation.SuppressLint
import com.facebook.jni.HybridClassBase
import com.facebook.proguard.annotations.DoNotStripAny
import com.facebook.react.bridge.NativeMap
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.bridge.UiThreadUtil
import com.facebook.react.bridge.WritableMap
import com.facebook.react.fabric.FabricSoLoader.staticInit
import com.facebook.react.uimanager.events.EventCategoryDef

Expand Down Expand Up @@ -46,14 +46,14 @@ internal class EventEmitterWrapper private constructor() : HybridClassBase() {
* Invokes the execution of the C++ EventEmitter.
*
* @param eventName [String] name of the event to execute.
* @param params [WritableMap] payload of the event
* @param params [ReadableMap] payload of the event
* @param eventCategory event category
* @param eventTimestamp timestamp when the event was triggered (in milliseconds since boot)
*/
@Synchronized
fun dispatch(
eventName: String,
params: WritableMap?,
params: ReadableMap?,
@EventCategoryDef eventCategory: Int,
eventTimestamp: Long,
) {
Expand All @@ -64,7 +64,7 @@ internal class EventEmitterWrapper private constructor() : HybridClassBase() {
}

@Synchronized
fun dispatchEventSynchronously(eventName: String, params: WritableMap?, eventTimestamp: Long) {
fun dispatchEventSynchronously(eventName: String, params: ReadableMap?, eventTimestamp: Long) {
if (!isValid) {
return
}
Expand All @@ -77,11 +77,11 @@ internal class EventEmitterWrapper private constructor() : HybridClassBase() {
* target.
*
* @param eventName [String] name of the event to execute.
* @param params [WritableMap] payload of the event
* @param params [ReadableMap] payload of the event
* @param eventTimestamp timestamp when the event was triggered (in milliseconds since boot)
*/
@Synchronized
fun dispatchUnique(eventName: String, params: WritableMap?, eventTimestamp: Long) {
fun dispatchUnique(eventName: String, params: ReadableMap?, eventTimestamp: Long) {
if (!isValid) {
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
package com.facebook.react.fabric.events

import android.os.SystemClock
import com.facebook.react.bridge.WritableMap
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.fabric.FabricUIManager
import com.facebook.react.uimanager.events.EventCategoryDef
import com.facebook.react.uimanager.events.RCTModernEventEmitter
Expand All @@ -22,7 +22,7 @@ internal class FabricEventEmitter(private val uiManager: FabricUIManager) : RCTM
eventName: String,
canCoalesceEvent: Boolean,
customCoalesceKey: Int,
params: WritableMap?,
params: ReadableMap?,
@EventCategoryDef category: Int,
) {
receiveEvent(
Expand All @@ -43,7 +43,7 @@ internal class FabricEventEmitter(private val uiManager: FabricUIManager) : RCTM
eventName: String,
canCoalesceEvent: Boolean,
customCoalesceKey: Int,
params: WritableMap?,
params: ReadableMap?,
@EventCategoryDef category: Int,
eventTimestamp: Long,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import com.facebook.react.bridge.ReadableArray
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.bridge.RetryableMountingLayerException
import com.facebook.react.bridge.UiThreadUtil.assertOnUiThread
import com.facebook.react.bridge.WritableMap
import com.facebook.react.fabric.events.EventEmitterWrapper
import com.facebook.react.fabric.mounting.mountitems.MountItem
import com.facebook.react.touch.JSResponderHandler
Expand Down Expand Up @@ -342,7 +341,7 @@ internal class MountingManager(
reactTag: Int,
eventName: String,
canCoalesceEvent: Boolean,
params: WritableMap?,
params: ReadableMap?,
@EventCategoryDef eventCategory: Int,
eventTimestamp: Long,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ internal constructor(
reactTag: Int,
eventName: String,
canCoalesceEvent: Boolean,
params: WritableMap?,
params: ReadableMap?,
@EventCategoryDef eventCategory: Int,
eventTimestamp: Long,
) {
Expand Down Expand Up @@ -1252,7 +1252,7 @@ internal constructor(

private class PendingViewEvent(
private val eventName: String,
private val params: WritableMap?,
private val params: ReadableMap?,
@field:EventCategoryDef private val eventCategory: Int,
private val canCoalesceEvent: Boolean,
private val eventTimestamp: Long,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package com.facebook.react.internal.interop

import com.facebook.react.bridge.WritableMap
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.common.annotations.internal.InteropLegacyArchitecture
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger
import com.facebook.react.uimanager.events.Event
Expand All @@ -20,14 +20,14 @@ import com.facebook.react.uimanager.events.Event
@InteropLegacyArchitecture
internal class InteropEvent(
@get:JvmName("eventName") val interopEventName: String,
@get:JvmName("eventData") val eventData: WritableMap?,
@get:JvmName("eventData") val eventData: ReadableMap?,
surfaceId: Int,
viewTag: Int,
) : Event<InteropEvent>(surfaceId, viewTag) {

override fun getEventName(): String = interopEventName

override fun getEventData(): WritableMap? = eventData
override fun getEventData(): ReadableMap? = eventData

private companion object {
init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
package com.facebook.react.internal.interop

import com.facebook.react.bridge.ReactContext
import com.facebook.react.bridge.WritableMap
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.common.annotations.VisibleForTesting
import com.facebook.react.common.annotations.internal.InteropLegacyArchitecture
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger
Expand All @@ -34,7 +34,7 @@ internal class InteropEventEmitter(private val reactContext: ReactContext) : RCT
private var eventDispatcherOverride: EventDispatcher? = null

@Deprecated("Deprecated in Java")
override fun receiveEvent(targetTag: Int, eventName: String, params: WritableMap?) {
override fun receiveEvent(targetTag: Int, eventName: String, params: ReadableMap?) {
val dispatcher = eventDispatcherOverride ?: UIManagerHelper.getEventDispatcher(reactContext)
val surfaceId = UIManagerHelper.getSurfaceId(reactContext)
dispatcher?.dispatchEvent(InteropEvent(eventName, params, surfaceId, targetTag))
Expand Down
Loading
Loading