CSSBackgroundDrawable

A subclass of Drawable used for background of . It supports drawing background color and borders (including rounded borders) by providing a react friendly API (setter for each of those properties).

The implementation tries to allocate as few objects as possible depending on which properties are set. E.g. for views with rounded background/borders we allocate mInnerClipPathForBorderRadius and mInnerClipTempRectForBorderRadius. In case when view have a rectangular borders we allocate mBorderWidthResult and similar. When only background color is set we won't allocate any extra/unnecessary objects.

Constructors

Link copied to clipboard
constructor(context: Context)

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun clearColorFilter()
Link copied to clipboard
fun copyBounds(bounds: Rect)
Link copied to clipboard
open fun createFromPath(pathName: String): Drawable
Link copied to clipboard
Link copied to clipboard
open fun createFromStream(is: InputStream, srcName: String): Drawable
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun draw(canvas: Canvas)
Link copied to clipboard
open fun getAlpha(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getBorderColor(position: Int): Int
Link copied to clipboard
open fun getBorderRadius(): BorderRadiusStyle
Link copied to clipboard
Link copied to clipboard
open fun getBorderWidth(spacingType: Int): Float
Link copied to clipboard
open fun getBorderWidthOrDefaultTo(defaultValue: Float, spacingType: Int): Float
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getColor(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getCurrent(): Drawable
Link copied to clipboard
open fun getDirtyBounds(): Rect
Link copied to clipboard
For rounded borders we use default "borderWidth" property.
Link copied to clipboard
open fun getHotspotBounds(outRect: Rect)
Link copied to clipboard
open fun getInnerBorderRadius(computedRadius: Float, borderWidth: Float): Float
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getLevel(): Int
Link copied to clipboard
open fun getMinimumHeight(): Int
Link copied to clipboard
open fun getMinimumWidth(): Int
Link copied to clipboard
open fun getOpacity(): Int
Link copied to clipboard
Link copied to clipboard
open fun getOutline(outline: Outline)
Link copied to clipboard
open fun getPadding(padding: Rect): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getState(): Array<Int>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun inflate(r: Resources, parser: XmlPullParser, attrs: AttributeSet)
Link copied to clipboard
open fun invalidateSelf()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun isProjected(): Boolean
Link copied to clipboard
open fun isStateful(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun mutate(): Drawable
Link copied to clipboard
open fun onLayoutDirectionChanged(layoutDirection: Int): Boolean
Link copied to clipboard
open fun resolveOpacity(op1: Int, op2: Int): Int
Link copied to clipboard
open fun scheduleSelf(what: Runnable, when: Long)
Link copied to clipboard
open fun setAlpha(alpha: Int)
Link copied to clipboard
open fun setAutoMirrored(mirrored: Boolean)
Link copied to clipboard
open fun setBackgroundImage(@Nullable backgroundImageLayers: List<BackgroundImageLayer>)
Link copied to clipboard
open fun setBorderColor(position: Int, @Nullable color: Integer)
Link copied to clipboard
open fun setBorderRadius(radius: BorderRadiusStyle)
Link copied to clipboard
open fun setBorderStyle(@Nullable borderStyle: BorderStyle)
open fun setBorderStyle(@Nullable style: String)
Link copied to clipboard
open fun setBorderWidth(position: Int, width: Float)
Link copied to clipboard
open fun setBounds(left: Int, top: Int, right: Int, bottom: Int)
Link copied to clipboard
Link copied to clipboard
open fun setChangingConfigurations(configs: Int)
Link copied to clipboard
open fun setColor(color: Int)
Link copied to clipboard
Link copied to clipboard
open fun setDither(dither: Boolean)
Link copied to clipboard
open fun setFilterBitmap(filter: Boolean)
Link copied to clipboard
open fun setHotspot(x: Float, y: Float)
Link copied to clipboard
open fun setHotspotBounds(left: Int, top: Int, right: Int, bottom: Int)
Link copied to clipboard
fun setLayoutDirection(layoutDirection: Int): Boolean
Link copied to clipboard
open fun setLayoutDirectionOverride(layoutDirection: Int)
Link copied to clipboard
fun setLevel(level: Int): Boolean
Link copied to clipboard
open fun setRadius(radius: Float)
open fun setRadius(radius: Float, position: Int)
Link copied to clipboard
open fun setState(stateSet: Array<Int>): Boolean
Link copied to clipboard
open fun setTint(tintColor: Int)
Link copied to clipboard
open fun setTintBlendMode(blendMode: BlendMode)
Link copied to clipboard
open fun setTintList(tint: ColorStateList)
Link copied to clipboard
open fun setTintMode(tintMode: PorterDuff.Mode)
Link copied to clipboard
open fun setVisible(visible: Boolean, restart: Boolean): Boolean
Link copied to clipboard
open fun unscheduleSelf(what: Runnable)