public abstract class Event<T extends Event>
extends java.lang.Object
EventDispatcher.dispatchEvent(com.facebook.react.uimanager.events.Event)
should be used. Once event object
is passed to the EventDispatched it should no longer be used as EventDispatcher may decide
to recycle that object (by calling dispose()
).Modifier | Constructor and Description |
---|---|
protected |
Event() |
protected |
Event(int viewTag) |
Modifier and Type | Method and Description |
---|---|
boolean |
canCoalesce() |
T |
coalesce(T otherEvent)
Given two events, coalesce them into a single event that will be sent to JS instead of two
separate events.
|
abstract void |
dispatch(RCTEventEmitter rctEventEmitter)
Dispatch this event to JS using the given event emitter.
|
short |
getCoalescingKey() |
abstract java.lang.String |
getEventName() |
long |
getTimestampMs() |
int |
getUniqueID() |
int |
getViewTag() |
protected void |
init(int viewTag)
This method needs to be called before event is sent to event dispatcher.
|
void |
onDispose()
Called when the EventDispatcher is done with an event, either because it was dispatched or
because it was coalesced with another Event.
|
protected void init(int viewTag)
public final int getViewTag()
public final long getTimestampMs()
SystemClock.uptimeMillis()
base.public boolean canCoalesce()
public T coalesce(T otherEvent)
public short getCoalescingKey()
public int getUniqueID()
public void onDispose()
public abstract java.lang.String getEventName()
public abstract void dispatch(RCTEventEmitter rctEventEmitter)