Migrate EventCategoryDef to Kotlin (#48446)

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

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D67759756

fbshipit-source-id: bc922b3062d8790ada3f9d5ee71593a08046752b
This commit is contained in:
Ruslan Shestopalyuk authored and Facebook GitHub Bot committed 2025-01-02 11:18:07 -08:00
1 parent 79c7c58656
commit e8347b9854
3 files changed
+55 -45

No files matched your search

@@ -5563,6 +5563,15 @@ public abstract interface class com/facebook/react/uimanager/events/Event$EventA
}
public abstract interface annotation class com/facebook/react/uimanager/events/EventCategoryDef : java/lang/annotation/Annotation {
public static final field CONTINUOUS I
public static final field CONTINUOUS_END I
public static final field CONTINUOUS_START I
public static final field Companion Lcom/facebook/react/uimanager/events/EventCategoryDef$Companion;
public static final field DISCRETE I
public static final field UNSPECIFIED I
}
public final class com/facebook/react/uimanager/events/EventCategoryDef$Companion {
public static final field CONTINUOUS I
public static final field CONTINUOUS_END I
public static final field CONTINUOUS_START I
@@ -1,45 +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.uimanager.events;
import static com.facebook.react.uimanager.events.EventCategoryDef.CONTINUOUS;
import static com.facebook.react.uimanager.events.EventCategoryDef.CONTINUOUS_END;
import static com.facebook.react.uimanager.events.EventCategoryDef.CONTINUOUS_START;
import static com.facebook.react.uimanager.events.EventCategoryDef.DISCRETE;
import static com.facebook.react.uimanager.events.EventCategoryDef.UNSPECIFIED;
import androidx.annotation.IntDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Java specific declaration of the `RawEvent::Category` enum. Keep in sync with
* `renderer/core/RawEvent.h`.
*/
@IntDef(value = {CONTINUOUS_START, CONTINUOUS_END, UNSPECIFIED, DISCRETE, CONTINUOUS})
@Retention(RetentionPolicy.SOURCE)
public @interface EventCategoryDef {
/** Start of a continuous event. To be used with touchStart. */
int CONTINUOUS_START = 0;
/** End of a continuous event. To be used with touchEnd. */
int CONTINUOUS_END = 1;
/**
* Priority for this event will be determined from other events in the queue. If it is triggered
* by continuous event, its priority will be default. If it is not triggered by continuous event,
* its priority will be discrete.
*/
int UNSPECIFIED = 2;
/** Forces discrete type for the event. Regardless if continuous event is ongoing. */
int DISCRETE = 3;
/** Forces continuous type for the event. Regardless if continuous event isn't ongoing. */
int CONTINUOUS = 4;
}
@@ -0,0 +1,46 @@
/*
* 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.uimanager.events
import androidx.annotation.IntDef
/**
* Kotlin/Java specific declaration of the `RawEvent::Category` enum. Keep in sync with
* `renderer/core/RawEvent.h`.
*/
@IntDef(
value =
[
EventCategoryDef.CONTINUOUS_START,
EventCategoryDef.CONTINUOUS_END,
EventCategoryDef.UNSPECIFIED,
EventCategoryDef.DISCRETE,
EventCategoryDef.CONTINUOUS])
@Retention(AnnotationRetention.SOURCE)
public annotation class EventCategoryDef {
public companion object {
/** Start of a continuous event. To be used with touchStart. */
public const val CONTINUOUS_START: Int = 0
/** End of a continuous event. To be used with touchEnd. */
public const val CONTINUOUS_END: Int = 1
/**
* Priority for this event will be determined from other events in the queue. If it is triggered
* by continuous event, its priority will be default. If it is not triggered by continuous
* event, its priority will be discrete.
*/
public const val UNSPECIFIED: Int = 2
/** Forces discrete type for the event. Regardless if continuous event is ongoing. */
public const val DISCRETE: Int = 3
/** Forces continuous type for the event. Regardless if continuous event isn't ongoing. */
public const val CONTINUOUS: Int = 4
}
}