public class

DropFramesFrameScheduler

extends Object
implements FrameScheduler
java.lang.Object
   ↳ com.facebook.fresco.animation.frame.DropFramesFrameScheduler

Class Overview

Frame scheduler that maps time values to frames.

Summary

[Expand]
Inherited Constants
From interface com.facebook.fresco.animation.frame.FrameScheduler
Public Constructors
DropFramesFrameScheduler(AnimationInformation animationInformation)
Public Methods
int getFrameNumberToRender(long animationTimeMs, long lastFrameTimeMs)
Get the frame number for the given animation time or FRAME_NUMBER_DONE if the animation is over.
long getLoopDurationMs()
Get the loop duration of 1 full loop.
long getTargetRenderTimeForNextFrameMs(long animationTimeMs)
For a given animation time, calculate the target render time for the next frame in ms.
long getTargetRenderTimeMs(int frameNumber)
Get the target render time for the given frame number in ms.
boolean isInfiniteAnimation()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.facebook.fresco.animation.frame.FrameScheduler

Public Constructors

public DropFramesFrameScheduler (AnimationInformation animationInformation)

Public Methods

public int getFrameNumberToRender (long animationTimeMs, long lastFrameTimeMs)

Get the frame number for the given animation time or FRAME_NUMBER_DONE if the animation is over.

Parameters
animationTimeMs the animation time to get the frame number for
lastFrameTimeMs the time of the last draw before
Returns

public long getLoopDurationMs ()

Get the loop duration of 1 full loop.

Returns
  • the loop duration in ms

public long getTargetRenderTimeForNextFrameMs (long animationTimeMs)

For a given animation time, calculate the target render time for the next frame in ms. If the animation is over, this will return NO_NEXT_TARGET_RENDER_TIME

Parameters
animationTimeMs the current animation time in ms
Returns
  • the target animation time in ms for the next frame after the given animation time or NO_NEXT_TARGET_RENDER_TIME if the animation is over

public long getTargetRenderTimeMs (int frameNumber)

Get the target render time for the given frame number in ms.

Parameters
frameNumber the frame number to use
Returns
  • the target render time

public boolean isInfiniteAnimation ()