Skip to main content

LinearGradientDrawable

declare class LinearGradientDrawable {}

LinearGradientDrawable

Static Method

MakeAngle

declare class LinearGradientDrawable {
static MakeAngle(deg: number, colors: number[]): LinearGradientDrawable
}
  • Description

    Creates a new fill linearGradientDrawable instance, specify the angle and color

MakeAngle

declare class LinearGradientDrawable {
static MakeAngle(deg: number, colors: number[], radius: number): LinearGradientDrawable
}
  • Description

    Creates a new fill radius linearGradientDrawable instance, specify the angle and color

MakeAngle

declare class LinearGradientDrawable {
static MakeAngle(deg: number, colors: number[], lt: number, rt: number, rb: number, lb: number): LinearGradientDrawable
}
  • Description

    Creates a new fill radius linearGradientDrawable instance, specify the angle and color

MakeAngle

declare class LinearGradientDrawable {
static MakeAngle(deg: number, colors: number[], radius: number, strokeWidth: number): LinearGradientDrawable
}
  • Description

    Creates a new stroke radius linearGradientDrawable instance, specify the angle and color

MakeAngle

declare class LinearGradientDrawable {
static MakeAngle(deg: number, colors: number[], lt: number, rt: number, rb: number, lb: number, strokeWidth: number): LinearGradientDrawable
}
  • Description

    Creates a new stroke radius linearGradientDrawable instance, specify the angle and color

MakeDirection

declare class LinearGradientDrawable {
static MakeDirection(dir: string, colors: number[]): LinearGradientDrawable
}
  • Description

    Creates a new fill linearGradientDrawable instance, specify the direction and color

MakeDirection

declare class LinearGradientDrawable {
static MakeDirection(dir: string, colors: number[], radius: number): LinearGradientDrawable
}
  • Description

    Creates a new fill radius linearGradientDrawable instance, specify the direction and color

MakeDirection

declare class LinearGradientDrawable {
static MakeDirection(dir: string, colors: number[], lt: number, rt: number, rb: number, lb: number): LinearGradientDrawable
}
  • Description

    Creates a new fill radius linearGradientDrawable instance, specify the direction and color

MakeDirection

declare class LinearGradientDrawable {
static MakeDirection(dir: string, colors: number[], radius: number, strokeWidth: number): LinearGradientDrawable
}
  • Description

    Creates a new stroke radius linearGradientDrawable instance, specify the direction and color

MakeDirection

declare class LinearGradientDrawable {
static MakeDirection(dir: string, colors: number[], lt: number, rt: number, rb: number, lb: number, strokeWidth: number): LinearGradientDrawable
}
  • Description

    Creates a new stroke radius linearGradientDrawable instance, specify the direction and color

Instance Method

draw

declare class LinearGradientDrawable {
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

declare class LinearGradientDrawable {
setAlpha(alpha: number): void
}
  • Description

    Specify an alpha value for the drawable.

onBoundsChange

declare class LinearGradientDrawable {
onBoundsChange(bounds: Rect): void
}
  • Description

    Override this in your subclass to change appearance if you vary based on the bounds.

copyBounds

declare class LinearGradientDrawable {
copyBounds() : Rect
}
  • Description

    Return a copy of the drawable's bounds in a new Rect.

copyBounds

declare class LinearGradientDrawable {
copyBounds(bounds: Rect): void
}
  • Description

    Return a copy of the drawable's bounds in the specified Rect (allocated by the caller).

getMinimumWidth

declare class LinearGradientDrawable {
getMinimumWidth(): number
}
  • Description

    Returns the minimum width suggested by this Drawable.

getMinimumHeight

declare class LinearGradientDrawable {
getMinimumHeight(): number
}
  • Description

    Returns the minimum height suggested by this Drawable.

getBounds

declare class LinearGradientDrawable {
getBounds(): Rect
}
  • Description

    Return the drawable's bounds Rect.

getOutline

declare class LinearGradientDrawable {
getOutline(outline:Outline):void
}
  • Description

    Called to get the drawable to populate the Outline that defines its drawing area.

getCallback

declare class LinearGradientDrawable {
getCallback() :Drawable.Callback
}
  • Description

    Return the current Callback implementation attached to this Drawable.

getIntrinsicWidth

declare class LinearGradientDrawable {
getIntrinsicWidth(): number
}
  • Description

    Returns the drawable's intrinsic width.

getIntrinsicHeight

declare class LinearGradientDrawable {
getIntrinsicHeight():number
}
  • Description

    Returns the drawable's intrinsic height.

setBounds

declare class LinearGradientDrawable {
setBounds(bounds: Rect): void
setBounds(left: number, top: number, right: number, bottom: number): void
}
  • Description

    Specify a bounding rectangle for the Drawable.

setCallback

declare class LinearGradientDrawable {
setCallback(callback: Drawable.Callback): void
}
  • Description

    Bind a Callback object to this Drawable.