public class BackdropFrameRenderer extends Thread implements Choreographer.FrameCallback
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
BackdropFrameRenderer(DecorView decorView,
ThreadedRenderer renderer,
Rect initialBounds,
Drawable resizingBackgroundDrawable,
Drawable captionBackgroundDrawable,
Drawable userCaptionBackgroundDrawable,
int statusBarColor,
int navigationBarColor,
boolean fullscreen,
Rect systemInsets,
Rect stableInsets,
int resizeMode) |
Modifier and Type | Method and Description |
---|---|
void |
doFrame(long frameTimeNanos)
The implementation of the FrameCallback.
|
void |
onConfigurationChange()
The window got replaced due to a configuration change.
|
boolean |
onContentDrawn(int xOffset,
int yOffset,
int xSize,
int ySize)
The content is about to be drawn and we got the location of where it will be shown.
|
void |
onRequestDraw(boolean reportNextDraw) |
void |
releaseRenderer()
All resources of the renderer will be released.
|
void |
run()
If this thread was constructed using a separate
Runnable run object, then that
Runnable object's run method is called;
otherwise, this method does nothing and returns. |
void |
setTargetRect(Rect newTargetBounds,
boolean fullscreen,
Rect systemInsets,
Rect stableInsets)
Call this function asynchronously when the window size has been changed or when the insets
have changed or whether window switched between a fullscreen or non-fullscreen layout.
|
activeCount, blockedOn, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, parkFor$, parkUntil$, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, unpark$, yield
public BackdropFrameRenderer(DecorView decorView, ThreadedRenderer renderer, Rect initialBounds, Drawable resizingBackgroundDrawable, Drawable captionBackgroundDrawable, Drawable userCaptionBackgroundDrawable, int statusBarColor, int navigationBarColor, boolean fullscreen, Rect systemInsets, Rect stableInsets, int resizeMode)
public void setTargetRect(Rect newTargetBounds, boolean fullscreen, Rect systemInsets, Rect stableInsets)
newTargetBounds
- The new target bounds.fullscreen
- Whether the window is currently drawing in fullscreen.systemInsets
- The current visible system insets for the window.stableInsets
- The stable insets for the window.public void onConfigurationChange()
public void releaseRenderer()
public void run()
Thread
Runnable
run object, then that
Runnable
object's run
method is called;
otherwise, this method does nothing and returns.
Subclasses of Thread
should override this method.
run
in interface Runnable
run
in class Thread
Thread.start()
,
Thread.stop()
,
Thread.Thread(ThreadGroup, Runnable, String)
public void doFrame(long frameTimeNanos)
doFrame
in interface Choreographer.FrameCallback
frameTimeNanos
- The time in nanoseconds when the frame started being rendered,
in the System.nanoTime()
timebase. Divide this value by 1000000
public boolean onContentDrawn(int xOffset, int yOffset, int xSize, int ySize)
xOffset
- The x offset where the content is drawn to.yOffset
- The y offset where the content is drawn to.xSize
- The width size of the content. This should not be 0.ySize
- The height of the content.public void onRequestDraw(boolean reportNextDraw)