public final class TimingModule extends NativeTimingSpec implements LifecycleEventListener, HeadlessJsTaskEventListener
| Modifier and Type | Class and Description |
|---|---|
class |
TimingModule.BridgeTimerManager |
NativeModule.NativeMethod| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
METHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC| Constructor and Description |
|---|
TimingModule(ReactApplicationContext reactContext,
DevSupportManager devSupportManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
createTimer(double callbackIDDouble,
double durationDouble,
double jsSchedulingTime,
boolean repeat) |
void |
deleteTimer(double timerIdDouble) |
java.lang.String |
getName() |
boolean |
hasActiveTimersInRange(long rangeMs) |
void |
initialize()
This is called at the end of
CatalystApplicationFragment#createCatalystInstance() after
the CatalystInstance has been created, in order to initialize NativeModules that require the
CatalystInstance or JS modules. |
void |
onCatalystInstanceDestroy()
Called before {CatalystInstance#onHostDestroy}
|
void |
onHeadlessJsTaskFinish(int taskId)
Called when a JS task finishes (i.e.
|
void |
onHeadlessJsTaskStart(int taskId)
Called when a JS task is started, on the UI thread.
|
void |
onHostDestroy()
Called when host activity receives destroy event (e.g.
|
void |
onHostPause()
Called when host activity receives pause event (e.g.
|
void |
onHostResume()
Called either when the host activity receives a resume event (e.g.
|
void |
setSendIdleEvents(boolean sendIdleEvents) |
getCurrentActivity, getReactApplicationContext, getReactApplicationContextIfActiveOrWarncanOverrideExistingModule, getConstants, hasConstants, invalidateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinvalidatepublic static final java.lang.String NAME
public TimingModule(ReactApplicationContext reactContext, DevSupportManager devSupportManager)
public void initialize()
NativeModuleCatalystApplicationFragment#createCatalystInstance() after
the CatalystInstance has been created, in order to initialize NativeModules that require the
CatalystInstance or JS modules.initialize in interface NativeModuleinitialize in class BaseJavaModulepublic java.lang.String getName()
getName in interface NativeModulerequire() this module
from javascript.public void createTimer(double callbackIDDouble,
double durationDouble,
double jsSchedulingTime,
boolean repeat)
createTimer in class NativeTimingSpecpublic void deleteTimer(double timerIdDouble)
deleteTimer in class NativeTimingSpecpublic void setSendIdleEvents(boolean sendIdleEvents)
setSendIdleEvents in class NativeTimingSpecpublic void onHostResume()
LifecycleEventListenerActivity#onResume or
if the native module that implements this is initialized while the host activity is already
resumed. Always called for the most current activity.onHostResume in interface LifecycleEventListenerpublic void onHostPause()
LifecycleEventListenerActivity#onPause. Always called
for the most current activity.onHostPause in interface LifecycleEventListenerpublic void onHostDestroy()
LifecycleEventListenerActivity#onDestroy. Only called
for the last React activity to be destroyed.onHostDestroy in interface LifecycleEventListenerpublic void onHeadlessJsTaskStart(int taskId)
HeadlessJsTaskEventListeneronHeadlessJsTaskStart in interface HeadlessJsTaskEventListenertaskId - the unique identifier of this task instancepublic void onHeadlessJsTaskFinish(int taskId)
HeadlessJsTaskEventListenerHeadlessJsTaskSupportModule#notifyTaskFinished is called, or when it times out), on the UI
thread.onHeadlessJsTaskFinish in interface HeadlessJsTaskEventListenerpublic void onCatalystInstanceDestroy()
NativeModuleonCatalystInstanceDestroy in interface NativeModuleonCatalystInstanceDestroy in class BaseJavaModulepublic boolean hasActiveTimersInRange(long rangeMs)