LiveDataDrawable

open class LiveDataDrawable(val liveData: LiveData<Drawable>) : DrawableWrapper

A Drawable that shows the current Drawable value from a liveData instance.

LiveDataDrawable will observe liveData while the drawable is visible. Drawables are considered visible when the View containing the drawable calls setVisible. This follows the pattern of AnimationDrawables, which start animating upon being made visible by their view.

Parameters

liveData

The drawable LiveData of which the current value is drawn. While the LiveDataDrawable is visible, getDrawable will match the value of liveData. This property is public to offer a convenient observer pattern clients can use to keep track of what this drawable is showing.

Constructors

Link copied to clipboard
constructor(liveData: LiveData<Drawable>)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun setTintList(tint: ColorStateList?)
Link copied to clipboard
open override fun setVisible(visible: Boolean, restart: Boolean): Boolean

Inherited functions

Link copied to clipboard
open override fun applyTheme(p0: Resources.Theme)
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
open override fun canApplyTheme(): Boolean
Link copied to clipboard
open fun clearColorFilter()
Link copied to clipboard
Link copied to clipboard
open override fun draw(p0: Canvas)
Link copied to clipboard
open override 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
open override fun getChangingConfigurations(): Int
Link copied to clipboard
open override fun getColorFilter(): ColorFilter?
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 getDrawable(): Drawable?
Link copied to clipboard
open override fun getHotspotBounds(p0: Rect)
Link copied to clipboard
open override fun getIntrinsicHeight(): Int
Link copied to clipboard
open override fun getIntrinsicWidth(): Int
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 override fun getOpacity(): Int
Link copied to clipboard
open override fun getOpticalInsets(): Insets
Link copied to clipboard
open override fun getOutline(p0: Outline)
Link copied to clipboard
open override fun getPadding(p0: Rect): Boolean
Link copied to clipboard
open fun getState(): IntArray
Link copied to clipboard
Link copied to clipboard
open override fun hasFocusStateSpecified(): Boolean
Link copied to clipboard
open override fun inflate(p0: Resources, p1: XmlPullParser, p2: AttributeSet, p3: Resources.Theme?)
Link copied to clipboard
open override fun invalidateDrawable(p0: Drawable)
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 override fun isStateful(): Boolean
Link copied to clipboard
Link copied to clipboard
open override fun jumpToCurrentState()
Link copied to clipboard
open override fun mutate(): Drawable
Link copied to clipboard
open override fun onLayoutDirectionChanged(p0: Int): Boolean
Link copied to clipboard
open override fun scheduleDrawable(p0: Drawable, p1: Runnable, p2: Long)
Link copied to clipboard
open fun scheduleSelf(p0: Runnable, p1: Long)
Link copied to clipboard
open override fun setAlpha(p0: Int)
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
open override fun setColorFilter(p0: ColorFilter?)
Link copied to clipboard
open fun setDither(p0: Boolean)
Link copied to clipboard
open fun setDrawable(p0: Drawable?)
Link copied to clipboard
open fun setFilterBitmap(p0: Boolean)
Link copied to clipboard
open override fun setHotspot(p0: Float, p1: Float)
Link copied to clipboard
open override 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
open override fun setTintBlendMode(p0: BlendMode)
Link copied to clipboard
Link copied to clipboard
open override fun unscheduleDrawable(p0: Drawable, p1: Runnable)
Link copied to clipboard
open fun unscheduleSelf(p0: Runnable)