Added in API level 1

NinePatchDrawable


open class NinePatchDrawable : Drawable
kotlin.Any
   ↳ android.graphics.drawable.Drawable
   ↳ android.graphics.drawable.NinePatchDrawable

A resizeable bitmap, with stretchable areas that you define. This type of image is defined in a .png file with a special format.

Summary

Public constructors
NinePatchDrawable(res: Resources!, bitmap: Bitmap!, chunk: ByteArray!, padding: Rect!, srcName: String!)

Create drawable from raw nine-patch data, setting initial target density based on the display metrics of the resources.

Create drawable from existing nine-patch, setting initial target density based on the display metrics of the resources.

NinePatchDrawable(bitmap: Bitmap!, chunk: ByteArray!, padding: Rect!, srcName: String!)

Create drawable from raw nine-patch data, not dealing with density.

Create drawable from existing nine-patch, not dealing with density.

Public methods
open Unit

Applies the specified theme to this Drawable and its children.

open Boolean

open Unit
draw(canvas: Canvas)

Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter).

open Int

Gets the current alpha value for the drawable.

open Int

Return a mask of the configuration parameters for which this drawable may change, requiring that it be re-created.

open Drawable.ConstantState?

Return a ConstantState instance that holds the shared state of this Drawable.

open Int

Returns the drawable's intrinsic height.

open Int

Returns the drawable's intrinsic width.

open Int

Return the opacity/transparency of this Drawable.

open Insets

Return in insets the layout insets suggested by this Drawable for use with alignment operations during layout.

open Unit
getOutline(outline: Outline)

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

open Boolean
getPadding(padding: Rect)

Return in padding the insets suggested by this Drawable for placing content inside the drawable's bounds.

open Paint

open Region?

Returns a Region representing the part of the Drawable that is completely transparent.

open Boolean

Indicates whether this drawable has at least one state spec explicitly specifying android.R.attr#state_focused.

open Unit
inflate(r: Resources, parser: XmlPullParser, attrs: AttributeSet, theme: Resources.Theme?)

Inflate this Drawable from an XML resource optionally styled by a theme.

open Boolean

Tells if this Drawable will be automatically mirrored when its layout direction is RTL right-to-left.

open Boolean

open Boolean

Indicates whether this drawable will change its appearance based on state.

open Drawable

Make this drawable mutable.

open Unit
setAlpha(alpha: Int)

Specify an alpha value for the drawable.

open Unit

Set whether this Drawable is automatically mirrored when its layout direction is RTL (right-to left).

open Unit
setColorFilter(colorFilter: ColorFilter?)

Specify an optional color filter for the drawable.

open Unit
setDither(dither: Boolean)

Set to true to have the drawable dither its colors when drawn to a device with fewer than 8-bits per color component.

open Unit

Set to true to have the drawable filter its bitmaps with bilinear sampling when they are scaled or rotated.

open Unit

Set the density scale at which this drawable will be rendered.

open Unit

Set the density scale at which this drawable will be rendered.

open Unit

Set the density at which this drawable will be rendered.

open Unit

Specifies a tint blending mode for this drawable.

open Unit

Specifies tint color for this drawable as a color state list.

Protected methods
open Boolean

Override this in your subclass to change appearance if you recognize the specified state.

Inherited functions