public class ChoreographerCompatImpl extends java.lang.Object implements ChoreographerCompat
This code was taken from the facebook/rebound repository.
ChoreographerCompat.FrameCallback
Modifier and Type | Method and Description |
---|---|
static ChoreographerCompat |
getInstance() |
void |
postFrameCallback(ChoreographerCompat.FrameCallback callbackWrapper) |
void |
postFrameCallbackDelayed(ChoreographerCompat.FrameCallback callbackWrapper,
long delayMillis) |
void |
removeFrameCallback(ChoreographerCompat.FrameCallback callbackWrapper) |
static void |
setInstance(ChoreographerCompat choreographerCompat)
Set the ChoreographerCompat instance for tests.
|
public static ChoreographerCompat getInstance()
ChoreographerCompat
instance for the main thread. This should really be on
ChoreographerCompat
but interfaces don't support static methods until Java 8.
NB: Unlike android.view.Choreographer#getInstance(), this method ALWAYS returns an instance that posts to the MAIN THREAD android Choreographer (and main thread Handler for API<16).
public static void setInstance(ChoreographerCompat choreographerCompat)
public void postFrameCallback(ChoreographerCompat.FrameCallback callbackWrapper)
postFrameCallback
in interface ChoreographerCompat
public void postFrameCallbackDelayed(ChoreographerCompat.FrameCallback callbackWrapper, long delayMillis)
postFrameCallbackDelayed
in interface ChoreographerCompat
public void removeFrameCallback(ChoreographerCompat.FrameCallback callbackWrapper)
removeFrameCallback
in interface ChoreographerCompat