Skip to content

Commit 55b87a5

Browse files
cortinicofacebook-github-bot
authored andcommitted
Make PointerEvent internal (#52131)
Summary: Pull Request resolved: #52131 This class is not used in OSS and can be made internal. Changelog: [Internal] [Changed] - Reviewed By: javache Differential Revision: D76979122 fbshipit-source-id: 2d81e3605e6c51336b3bdb2671dd9faf8f25639b
1 parent 0cf2985 commit 55b87a5

2 files changed

Lines changed: 16 additions & 49 deletions

File tree

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4890,38 +4890,6 @@ public final class com/facebook/react/uimanager/events/NativeGestureUtil {
48904890
public static final fun notifyNativeGestureStarted (Landroid/view/View;Landroid/view/MotionEvent;)V
48914891
}
48924892

4893-
public final class com/facebook/react/uimanager/events/PointerEvent : com/facebook/react/uimanager/events/Event {
4894-
public static final field Companion Lcom/facebook/react/uimanager/events/PointerEvent$Companion;
4895-
public fun dispatch (Lcom/facebook/react/uimanager/events/RCTEventEmitter;)V
4896-
public fun dispatchModern (Lcom/facebook/react/uimanager/events/RCTModernEventEmitter;)V
4897-
public fun getCoalescingKey ()S
4898-
public fun getEventAnimationDriverMatchSpec ()Lcom/facebook/react/uimanager/events/Event$EventAnimationDriverMatchSpec;
4899-
public fun getEventName ()Ljava/lang/String;
4900-
public static final fun obtain (Ljava/lang/String;ILcom/facebook/react/uimanager/events/PointerEvent$PointerEventState;Landroid/view/MotionEvent;)Lcom/facebook/react/uimanager/events/PointerEvent;
4901-
public static final fun obtain (Ljava/lang/String;ILcom/facebook/react/uimanager/events/PointerEvent$PointerEventState;Landroid/view/MotionEvent;S)Lcom/facebook/react/uimanager/events/PointerEvent;
4902-
public fun onDispose ()V
4903-
}
4904-
4905-
public final class com/facebook/react/uimanager/events/PointerEvent$Companion {
4906-
public final fun obtain (Ljava/lang/String;ILcom/facebook/react/uimanager/events/PointerEvent$PointerEventState;Landroid/view/MotionEvent;)Lcom/facebook/react/uimanager/events/PointerEvent;
4907-
public final fun obtain (Ljava/lang/String;ILcom/facebook/react/uimanager/events/PointerEvent$PointerEventState;Landroid/view/MotionEvent;S)Lcom/facebook/react/uimanager/events/PointerEvent;
4908-
}
4909-
4910-
public final class com/facebook/react/uimanager/events/PointerEvent$PointerEventState {
4911-
public fun <init> (IIIILjava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Set;)V
4912-
public final fun getActivePointerId ()I
4913-
public final fun getEventCoordinatesByPointerId ()Ljava/util/Map;
4914-
public final fun getHitPathByPointerId ()Ljava/util/Map;
4915-
public final fun getHitPathForActivePointer ()Ljava/util/List;
4916-
public final fun getHoveringPointerIds ()Ljava/util/Set;
4917-
public final fun getLastButtonState ()I
4918-
public final fun getOffsetByPointerId ()Ljava/util/Map;
4919-
public final fun getPrimaryPointerId ()I
4920-
public final fun getScreenCoordinatesByPointerId ()Ljava/util/Map;
4921-
public final fun getSurfaceId ()I
4922-
public final fun supportsHover (I)Z
4923-
}
4924-
49254893
public abstract interface class com/facebook/react/uimanager/events/RCTEventEmitter : com/facebook/react/bridge/JavaScriptModule {
49264894
public abstract fun receiveEvent (ILjava/lang/String;Lcom/facebook/react/bridge/WritableMap;)V
49274895
public abstract fun receiveTouches (Ljava/lang/String;Lcom/facebook/react/bridge/WritableArray;Lcom/facebook/react/bridge/WritableArray;)V

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.kt

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import com.facebook.react.uimanager.events.PointerEventHelper.getPressure
2424
import com.facebook.react.uimanager.events.PointerEventHelper.getW3CPointerType
2525
import com.facebook.react.uimanager.events.PointerEventHelper.isBubblingEvent
2626

27-
public class PointerEvent private constructor() : Event<PointerEvent>() {
27+
internal class PointerEvent private constructor() : Event<PointerEvent>() {
2828
private var motionEvent: MotionEvent? = null
2929
private lateinit var _eventName: String
3030
private var coalescingKey = UNSET_COALESCING_KEY
@@ -269,36 +269,35 @@ public class PointerEvent private constructor() : Event<PointerEvent>() {
269269
}
270270
}
271271

272-
public class PointerEventState
273-
public constructor(
274-
public val primaryPointerId: Int,
275-
public val activePointerId: Int,
276-
public val lastButtonState: Int,
272+
class PointerEventState(
273+
val primaryPointerId: Int,
274+
val activePointerId: Int,
275+
val lastButtonState: Int,
277276
private val surfaceId: Int,
278-
public val offsetByPointerId: Map<Int, FloatArray>,
279-
public val hitPathByPointerId: Map<Int, List<ViewTarget>>,
280-
public val eventCoordinatesByPointerId: Map<Int, FloatArray>,
281-
public val screenCoordinatesByPointerId: Map<Int, FloatArray>,
277+
val offsetByPointerId: Map<Int, FloatArray>,
278+
val hitPathByPointerId: Map<Int, List<ViewTarget>>,
279+
val eventCoordinatesByPointerId: Map<Int, FloatArray>,
280+
val screenCoordinatesByPointerId: Map<Int, FloatArray>,
282281
hoveringPointerIds: Set<Int>
283282
) {
284-
public val hoveringPointerIds: Set<Int> = HashSet(hoveringPointerIds)
283+
val hoveringPointerIds: Set<Int> = HashSet(hoveringPointerIds)
285284

286-
public fun getSurfaceId(): Int = surfaceId
285+
fun getSurfaceId(): Int = surfaceId
287286

288-
public fun supportsHover(pointerId: Int): Boolean = hoveringPointerIds.contains(pointerId)
287+
fun supportsHover(pointerId: Int): Boolean = hoveringPointerIds.contains(pointerId)
289288

290-
public val hitPathForActivePointer: List<ViewTarget>
289+
val hitPathForActivePointer: List<ViewTarget>
291290
get() = checkNotNull(hitPathByPointerId[activePointerId])
292291
}
293292

294-
public companion object {
293+
companion object {
295294
private val TAG: String = PointerEvent::class.java.simpleName
296295
private const val POINTER_EVENTS_POOL_SIZE = 6
297296
private val EVENTS_POOL = SynchronizedPool<PointerEvent>(POINTER_EVENTS_POOL_SIZE)
298297
private const val UNSET_COALESCING_KEY: Short = -1
299298

300299
@JvmStatic
301-
public fun obtain(
300+
fun obtain(
302301
eventName: String,
303302
targetTag: Int,
304303
eventState: PointerEventState,
@@ -318,7 +317,7 @@ public class PointerEvent private constructor() : Event<PointerEvent>() {
318317
}
319318

320319
@JvmStatic
321-
public fun obtain(
320+
fun obtain(
322321
eventName: String,
323322
targetTag: Int,
324323
eventState: PointerEventState,

0 commit comments

Comments
 (0)