Most visited

Recently visited

Added in API level 1

Drawable.Callback

public static interface Drawable.Callback

android.graphics.drawable.Drawable.Callback
Known Indirect Subclasses


如果您想要创建一个可扩展Drawable的动画绘图,请实现此界面。 在检索drawable时,使用setCallback(android.graphics.drawable.Drawable.Callback)为drawable提供接口的实现; 它使用此接口来安排和执行动画更改。

Summary

Public methods

abstract void invalidateDrawable(Drawable who)

当drawable需要重绘时调用。

abstract void scheduleDrawable(Drawable who, Runnable what, long when)

Drawable可以调用它来安排动画的下一帧。

abstract void unscheduleDrawable(Drawable who, Runnable what)

Drawable可以调用此 scheduleDrawable(Drawable, Runnable, long)调度先前预定为 scheduleDrawable(Drawable, Runnable, long)

Public methods

invalidateDrawable

Added in API level 1
void invalidateDrawable (Drawable who)

当drawable需要重绘时调用。 在这一点上的观点应该使自己失效(或者至少是可绘制出现的部分)。

Parameters
who Drawable: The drawable that is requesting the update.

scheduleDrawable

Added in API level 1
void scheduleDrawable (Drawable who, 
                Runnable what, 
                long when)

Drawable可以调用它来安排动画的下一帧。 实现通常可以简单地使用参数(什么,谁,何时)来调用postAtTime(Runnable, Object, long)来执行调度。

Parameters
who Drawable: The drawable being scheduled.
what Runnable: The action to execute.
when long: The time (in milliseconds) to run. The timebase is uptimeMillis()

unscheduleDrawable

Added in API level 1
void unscheduleDrawable (Drawable who, 
                Runnable what)

Drawable可以调用它来scheduleDrawable(Drawable, Runnable, long)调度先前预定的行为scheduleDrawable(Drawable, Runnable, long) 一个实现通常可以简单地调用removeCallbacks(Runnable, Object)的参数(什么,谁)removeCallbacks(Runnable, Object) drawable。

Parameters
who Drawable: The drawable being unscheduled.
what Runnable: The action being unscheduled.

Hooray!