Package 

Class TimingModule

  • All Implemented Interfaces:
    com.facebook.react.bridge.LifecycleEventListener , com.facebook.react.bridge.NativeModule , com.facebook.react.bridge.ReactModuleWithSpec , com.facebook.react.jstasks.HeadlessJsTaskEventListener , com.facebook.react.turbomodule.core.interfaces.TurboModule

    
    public final class TimingModule
    extends NativeTimingSpec implements LifecycleEventListener, HeadlessJsTaskEventListener
                        

    Native module for JS timer execution. Timers fire on frame boundaries.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static String NAME
    • Method Summary

      Modifier and Type Method Description
      void initialize() This is called at the end of createCatalystInstance afterthe CatalystInstance has been created, in order to initialize NativeModules that require theCatalystInstance or JS modules.
      String getName()
      void createTimer(double callbackIDDouble, double durationDouble, double jsSchedulingTime, boolean repeat)
      void deleteTimer(double timerIdDouble)
      void setSendIdleEvents(boolean sendIdleEvents)
      void onHostResume() Called either when the host activity receives a resume event (e.g.
      void onHostPause() Called when host activity receives pause event (e.g.
      void onHostDestroy() Called when host activity receives destroy event (e.g.
      void onHeadlessJsTaskStart(int taskId) Called when a JS task is started, on the UI thread.
      void onHeadlessJsTaskFinish(int taskId) Called when a JS task finishes (i.e.
      void invalidate() The CatalystInstance is going away with Venice.
      boolean hasActiveTimersInRange(long rangeMs)
      • Methods inherited from class com.facebook.fbreact.specs.NativeTimingSpec

        createTimer, deleteTimer, setSendIdleEvents
      • Methods inherited from class com.facebook.react.bridge.BaseJavaModule

        canOverrideExistingModule, getConstants, hasConstants, onCatalystInstanceDestroy
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • initialize

         void initialize()

        This is called at the end of createCatalystInstance afterthe CatalystInstance has been created, in order to initialize NativeModules that require theCatalystInstance or JS modules.

      • createTimer

         void createTimer(double callbackIDDouble, double durationDouble, double jsSchedulingTime, boolean repeat)
      • onHostResume

         void onHostResume()

        Called either when the host activity receives a resume event (e.g. onResume orif the native module that implements this is initialized while the host activity is alreadyresumed. Always called for the most current activity.

      • onHostPause

         void onHostPause()

        Called when host activity receives pause event (e.g. onPause. Always calledfor the most current activity.

      • onHostDestroy

         void onHostDestroy()

        Called when host activity receives destroy event (e.g. onDestroy. Only calledfor the last React activity to be destroyed.

      • onHeadlessJsTaskStart

         void onHeadlessJsTaskStart(int taskId)

        Called when a JS task is started, on the UI thread.

        Parameters:
        taskId - the unique identifier of this task instance
      • onHeadlessJsTaskFinish

         void onHeadlessJsTaskFinish(int taskId)

        Called when a JS task finishes (i.e. when is called, or when it times out), on the UIthread.

      • invalidate

         void invalidate()

        The CatalystInstance is going away with Venice. Therefore, the TurboModule infra introduces theinvalidate() method to allow NativeModules to clean up after themselves.