Kotlinify ViewGroupClickEvent (#43866)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43866

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: tdn120

Differential Revision: D55749364

fbshipit-source-id: 184c43da537e550842cb9a675c525fa18cdee9f6
This commit is contained in:
Fabrizio Cucci
2024-04-05 17:00:47 -07:00
committed by Facebook GitHub Bot
parent 93a2dd9545
commit a0d809cdd3
3 changed files with 32 additions and 48 deletions
@@ -7810,11 +7810,10 @@ public class com/facebook/react/views/view/ReactViewManager$$PropsSetter : com/f
public fun setProperty (Lcom/facebook/react/views/view/ReactViewManager;Lcom/facebook/react/views/view/ReactViewGroup;Ljava/lang/String;Ljava/lang/Object;)V
}
public class com/facebook/react/views/view/ViewGroupClickEvent : com/facebook/react/uimanager/events/Event {
public final class com/facebook/react/views/view/ViewGroupClickEvent : com/facebook/react/uimanager/events/Event {
public fun <init> (I)V
public fun <init> (II)V
public fun canCoalesce ()Z
protected fun getEventData ()Lcom/facebook/react/bridge/WritableMap;
public fun getEventName ()Ljava/lang/String;
}
@@ -1,46 +0,0 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.views.view;
import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.uimanager.common.ViewUtil;
import com.facebook.react.uimanager.events.Event;
/** Represents a Click on the ReactViewGroup */
@Nullsafe(Nullsafe.Mode.LOCAL)
public class ViewGroupClickEvent extends Event<ViewGroupClickEvent> {
private static final String EVENT_NAME = "topClick";
@Deprecated
public ViewGroupClickEvent(int viewId) {
this(ViewUtil.NO_SURFACE_ID, viewId);
}
public ViewGroupClickEvent(int surfaceId, int viewId) {
super(surfaceId, viewId);
}
@Override
public String getEventName() {
return EVENT_NAME;
}
@Override
public boolean canCoalesce() {
return false;
}
@Nullable
@Override
protected WritableMap getEventData() {
return Arguments.createMap();
}
}
@@ -0,0 +1,31 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.react.views.view
import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.WritableMap
import com.facebook.react.uimanager.common.ViewUtil
import com.facebook.react.uimanager.events.Event
/** Represents a Click on the ReactViewGroup */
public class ViewGroupClickEvent(surfaceId: Int, viewId: Int) :
Event<ViewGroupClickEvent>(surfaceId, viewId) {
@Deprecated("Use the constructor with surfaceId and viewId parameters.")
public constructor(viewId: Int) : this(ViewUtil.NO_SURFACE_ID, viewId)
override public fun getEventName(): String = EVENT_NAME
override public fun canCoalesce(): Boolean = false
override protected fun getEventData(): WritableMap = Arguments.createMap()
private companion object {
private const val EVENT_NAME: String = "topClick"
}
}