Class ShadowChoreographer

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long getFrameInterval()
      Return the current inter-frame interval.
      static void setFrameInterval​(long frameInterval)
      Set the inter-frame interval used to advance the clock.
      static void setPostCallbackDelay​(int delayMillis)
      Allows application to specify a fixed amount of delay when #postCallback(int, Runnable, Object) is invoked.
      static void setPostFrameCallbackDelay​(int delayMillis)
      Allows application to specify a fixed amount of delay when #postFrameCallback(FrameCallback) is invoked.
      • Methods inherited from class java.lang.Object

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

      • ShadowChoreographer

        public ShadowChoreographer()
    • Method Detail

      • setPostCallbackDelay

        public static void setPostCallbackDelay​(int delayMillis)
        Allows application to specify a fixed amount of delay when #postCallback(int, Runnable, Object) is invoked. The default delay value is 0. This can be used to avoid infinite animation tasks to be spawned when the Robolectric Scheduler is in Scheduler.IdleState.PAUSED mode.

        Only supported in LooperMode.Mode.LEGACY

      • setPostFrameCallbackDelay

        public static void setPostFrameCallbackDelay​(int delayMillis)
        Allows application to specify a fixed amount of delay when #postFrameCallback(FrameCallback) is invoked. The default delay value is 0. This can be used to avoid infinite animation tasks to be spawned when the Robolectric Scheduler is in Scheduler.IdleState.PAUSED mode.

        Only supported in LooperMode.Mode.LEGACY

      • getFrameInterval

        public static long getFrameInterval()
        Return the current inter-frame interval.

        Can only be used in LooperMode.Mode.LEGACY

        Returns:
        Inter-frame interval.
      • setFrameInterval

        public static void setFrameInterval​(long frameInterval)
        Set the inter-frame interval used to advance the clock. By default, this is set to 1ms.

        Only supported in LooperMode.Mode.LEGACY

        Parameters:
        frameInterval - Inter-frame interval.