Package org.robolectric.shadows
Class ShadowChoreographer
java.lang.Object
org.robolectric.shadows.ShadowChoreographer
- Direct Known Subclasses:
ShadowLegacyChoreographer,ShadowPausedChoreographer
@Implements(value=android.view.Choreographer.class, shadowPicker=Picker.class) public abstract class ShadowChoreographer extends Object
The shadow API for
Choreographer.
Different shadow implementations will be used depending on the current LooperMode. See
ShadowLegacyChoreographer and ShadowPausedChoreographer for details.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceShadowChoreographer.ChoreographerReflectorAccessor interface forChoreographer's internalsstatic classShadowChoreographer.Picker -
Constructor Summary
Constructors Constructor Description ShadowChoreographer() -
Method Summary
Modifier and Type Method Description protected voiddoFrame(long frameTimeNanos, int frame)static longgetFrameInterval()Return the current inter-frame interval.static voidsetFrameInterval(long frameInterval)Set the inter-frame interval used to advance the clock.static voidsetPostCallbackDelay(int delayMillis)Allows application to specify a fixed amount of delay when#postCallback(int, Runnable, Object)is invoked.static voidsetPostFrameCallbackDelay(int delayMillis)Allows application to specify a fixed amount of delay when#postFrameCallback(FrameCallback)is invoked.
-
Constructor Details
-
ShadowChoreographer
public ShadowChoreographer()
-
-
Method Details
-
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 RobolectricScheduleris inScheduler.IdleState.PAUSEDmode.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 in LooperMode PAUSED orScheduler.IdleState.PAUSEDand displaying an animation. -
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.
-
doFrame
-