TextDrawable

class TextDrawable(context: Context, text: String, @ColorInt textColor: Int) : Drawable

A Drawable that draws the given text. The text will be placed in the center of the drawable's bounding rectangle.

Parameters

context

The display context.

text

The text to be drawn on the screen.

textColor

The color to draw the text.

Constructors

Link copied to clipboard
constructor(context: Context, text: String, @ColorInt textColor: Int)

Functions

Link copied to clipboard
open override fun draw(canvas: Canvas)
Link copied to clipboard
open override fun getOpacity(): Int
Link copied to clipboard
open override fun setAlpha(alpha: Int)
Link copied to clipboard
open override fun setColorFilter(colorFilter: ColorFilter?)

Inherited functions

Link copied to clipboard
Link copied to clipboard
suspend fun Drawable.blur(context: Context, @Px blurRadiusPx: Float, samplingMultiplier: Float = DEFAULT_SAMPLING_MULTIPLIER): Drawable

Creates a blurred version of a drawable.

Link copied to clipboard
Link copied to clipboard
open fun clearColorFilter()
Link copied to clipboard
Link copied to clipboard
open fun getAlpha(): Int
Link copied to clipboard
Link copied to clipboard
suspend fun Drawable.getBrightnessAdjustedDominantColor(@ColorInt defaultColor: Int, dispatcher: CoroutineDispatcher = Dispatchers.Default): Int

Returns the drawable's dominant color with a brightness adjustment. If no dominant color is available it falls back to defaultColor. The brightness value of the dominant color is adjusted to an average value in between the original one and the defaultColor brightness value. Therefore, the returned dominant color can be brighter or darker than the original dominant color.

Link copied to clipboard
Link copied to clipboard
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
open fun getHotspotBounds(p0: Rect)
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
Link copied to clipboard
open fun getOutline(p0: Outline)
Link copied to clipboard
open fun getPadding(p0: Rect): Boolean
Link copied to clipboard
open fun getState(): IntArray
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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
Link copied to clipboard
open fun scheduleSelf(p0: Runnable, p1: Long)
Link copied to clipboard
open fun setAutoMirrored(p0: Boolean)
Link copied to clipboard
open fun setBounds(p0: Rect)
open fun setBounds(p0: Int, p1: Int, p2: Int, p3: Int)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun setDither(p0: Boolean)
Link copied to clipboard
open fun setFilterBitmap(p0: Boolean)
Link copied to clipboard
open fun setHotspot(p0: Float, p1: Float)
Link copied to clipboard
open fun setHotspotBounds(p0: Int, p1: Int, p2: Int, p3: Int)
Link copied to clipboard
Link copied to clipboard
fun setLevel(p0: Int): Boolean
Link copied to clipboard
open fun setState(p0: IntArray): Boolean
Link copied to clipboard
open fun setTint(p0: Int)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun setVisible(p0: Boolean, p1: Boolean): Boolean
Link copied to clipboard
open fun unscheduleSelf(p0: Runnable)