Drawable
declare class Drawable {}
Drawable
Instance Method
constructor
Signature
declare class Drawable {
constructor();
constructor(drawable: Drawable);
}
Description
Create a new Drawable
draw
Signature
declare class Drawable {
draw(canvas: Canvas): void
}
Description
Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter).
setAlpha
Signature
declare class Drawable {
setAlpha(alpha: number): void
}
Description
Specify an alpha value for the drawable.
onBoundsChange
Signature
declare class Drawable {
onBoundsChange(bounds: Rect): void
}
Description
Override this in your subclass to change appearance if you vary based on the bounds.
copyBounds
Signature
declare class Drawable {
copyBounds() : Rect
}
Description
Return a copy of the drawable's bounds in a new Rect.
copyBounds
Signature
declare class Drawable {
copyBounds(bounds: Rect): void
}
Description
Return a copy of the drawable's bounds in the specified Rect (allocated by the caller).
getMinimumWidth
Signature
declare class Drawable {
getMinimumWidth(): number
}
Description
Returns the minimum width suggested by this Drawable.
getMinimumHeight
Signature
declare class Drawable {
getMinimumHeight(): number
}
Description
Returns the minimum height suggested by this Drawable.
getBounds
Signature
declare class Drawable {
getBounds(): Rect
}
Description
Return the drawable's bounds Rect.
getOutline
Signature
declare class Drawable {
getOutline(outline:Outline):void
}
Description
Called to get the drawable to populate the Outline that defines its drawing area.
getCallback
Signature
declare class Drawable {
getCallback() :Drawable.Callback
}
Description
Return the currentCallback
implementation attached to this Drawable.
getIntrinsicWidth
Signature
declare class Drawable {
getIntrinsicWidth(): number
}
Description
Returns the drawable's intrinsic width.
getIntrinsicHeight
Signature
declare class Drawable {
getIntrinsicHeight():number
}
Description
Returns the drawable's intrinsic height.
getIntrinsicHeight
Signature
declare class Drawable {
setBounds(bounds: Rect): void;
setBounds(left: number, top: number, right: number, bottom: number): void;
}
Description
Specify a bounding rectangle for the Drawable.
setCallback
Signature
declare class Drawable {
setCallback(callback: Drawable.Callback): void
}
Description
Bind aCallback
object to this Drawable.
Drawable.ConstantState
ConstantState
declare abstract class ConstantState {
public abstract newDrawable(): Drawable;
public newResourcesDrawable(res: Resources): Drawable;
public abstract getChangingConfigurations(): number;
}
Instance Method
newDrawable
Signature
declare class ConstantState {
newDrawable(): Drawable
}
Description
Creates a new Drawable instance from its constant state.
newResourcesDrawable
Signature
declare class ConstantState {
newResourcesDrawable(res: Resources): Drawable
}
Description
Creates a new Drawable instance from its constant state using the specified resources.
getChangingConfigurations
Signature
declare class ConstantState {
getChangingConfigurations(): number
}
Description
Return a bit mask of configuration changes that will impact this drawable (and thus require completely reloading it).
Drawable.Callback
Callback
declare interface Callback {
invalidateDrawable(who:Drawable): void
scheduleDrawable(who: Drawable, what: Runnable, when: number): void
unScheduleDrawable(who: Drawable, what: Runnable): void
}
Instance Method
invalidateDrawable
Signature
declare class ConstantState {
invalidateDrawable(who:Drawable): void
}
Description
Called when the drawable needs to be redrawn.
scheduleDrawable
Signature
declare class ConstantState {
scheduleDrawable(who: Drawable, what: Runnable, when: number): void
}
Description
A Drawable can call this to schedule the next frame of its animation.
unScheduleDrawable
Signature
declare class ConstantState {
unScheduleDrawable(who: Drawable, what: Runnable): void
}
Description
A Drawable can call this to unschedule an action previously scheduled withscheduleDrawable(Drawable, Runnable, long)
.