Added in API level 1

PaintDrawable


open class PaintDrawable : ShapeDrawable
kotlin.Any
   ↳ android.graphics.drawable.Drawable
   ↳ android.graphics.drawable.ShapeDrawable
   ↳ android.graphics.drawable.PaintDrawable

Drawable that draws its bounds in the given paint, with optional rounded corners.

Summary

Inherited XML attributes
Public constructors

Public methods
open Unit

Specify radii for each of the 4 corners.

open Unit

Specify radius for the corners of the rectangle.

Protected methods
open Boolean
inflateTag(name: String!, r: Resources!, parser: XmlPullParser!, attrs: AttributeSet!)

Inherited functions

Public constructors

PaintDrawable

Added in API level 1
PaintDrawable()

PaintDrawable

Added in API level 1
PaintDrawable(color: Int)

Public methods

setCornerRadii

Added in API level 1
open fun setCornerRadii(radii: FloatArray!): Unit

Specify radii for each of the 4 corners. For each corner, the array contains 2 values, [X_radius, Y_radius]. The corners are ordered top-left, top-right, bottom-right, bottom-left

Parameters
radii FloatArray!: the x and y radii of the corners

setCornerRadius

Added in API level 1
open fun setCornerRadius(radius: Float): Unit

Specify radius for the corners of the rectangle. If this is > 0, then the drawable is drawn in a round-rectangle, rather than a rectangle.

Parameters
radius Float: the radius for the corners of the rectangle

Protected methods

inflateTag

Added in API level 1
protected open fun inflateTag(
    name: String!,
    r: Resources!,
    parser: XmlPullParser!,
    attrs: AttributeSet!
): Boolean