public static interface Drawable.Callback
Drawable
.
Upon retrieving a drawable, use
Drawable.setCallback(android.graphics.drawable.Drawable.Callback)
to supply your implementation of the interface to the drawable; it uses
this interface to schedule and execute animation changes.Modifier and Type | Method and Description |
---|---|
void |
invalidateDrawable(Drawable who)
Called when the drawable needs to be redrawn.
|
void |
scheduleDrawable(Drawable who,
Runnable what,
long when)
A Drawable can call this to schedule the next frame of its
animation.
|
void |
unscheduleDrawable(Drawable who,
Runnable what)
A Drawable can call this to unschedule an action previously
scheduled with
scheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable, long) . |
void invalidateDrawable(Drawable who)
who
- The drawable that is requesting the update.void scheduleDrawable(Drawable who, Runnable what, long when)
Handler.postAtTime(Runnable, Object, long)
with
the parameters (what, who, when) to perform the
scheduling.who
- The drawable being scheduled.what
- The action to execute.when
- The time (in milliseconds) to run. The timebase is
SystemClock.uptimeMillis()
void unscheduleDrawable(Drawable who, Runnable what)
scheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable, long)
. An implementation can
generally simply call
Handler.removeCallbacks(Runnable, Object)
with
the parameters (what, who) to unschedule the drawable.who
- The drawable being unscheduled.what
- The action being unscheduled.