public class JavaTimerManager
extends java.lang.Object
ReactChoreographer
.
This is used by the NativeModule TimingModule
.
Constructor and Description |
---|
JavaTimerManager(ReactApplicationContext reactContext,
JavaScriptTimerManager javaScriptTimerManager,
ReactChoreographer reactChoreographer,
DevSupportManager devSupportManager) |
Modifier and Type | Method and Description |
---|---|
void |
createAndMaybeCallTimer(int callbackID,
int duration,
double jsSchedulingTime,
boolean repeat)
A method to be used for asynchronously creating a timer.
|
void |
createTimer(int callbackID,
long delay,
boolean repeat)
A method to be used for synchronously creating a timer.
|
void |
deleteTimer(int timerId) |
void |
onHeadlessJsTaskFinish(int taskId) |
void |
onHeadlessJsTaskStart(int taskId) |
void |
onHostDestroy() |
void |
onHostPause() |
void |
onHostResume() |
void |
onInstanceDestroy() |
void |
setSendIdleEvents(boolean sendIdleEvents) |
public JavaTimerManager(ReactApplicationContext reactContext, JavaScriptTimerManager javaScriptTimerManager, ReactChoreographer reactChoreographer, DevSupportManager devSupportManager)
public void onHostPause()
public void onHostDestroy()
public void onHostResume()
public void onHeadlessJsTaskStart(int taskId)
public void onHeadlessJsTaskFinish(int taskId)
public void onInstanceDestroy()
public void createTimer(int callbackID, long delay, boolean repeat)
callbackID
- An identifier for the callback that can be passed to JS or C++ to invoke it.delay
- The time in ms before the callback should be invoked.repeat
- Whether the timer should be repeated (used for setInterval).public void createAndMaybeCallTimer(int callbackID, int duration, double jsSchedulingTime, boolean repeat)
callbackID
- An identifier that can be passed back to JS to invoke the callback.duration
- The time in ms before the callback should be invoked.jsSchedulingTime
- The time (ms since epoch) when this timer was created in JS.repeat
- Whether the timer should be repeated (used for setInterval)public void deleteTimer(int timerId)
public void setSendIdleEvents(boolean sendIdleEvents)