LiveDataDrawable

open class LiveDataDrawable(liveData: LiveData<Drawable>, initialDrawable: 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.

initialDrawable

The drawable that is shown initially before liveData has a value. Can be null, in which case nothing is drawn as long as liveData has no value set yet.

Constructors

Link copied to clipboard
fun LiveDataDrawable(liveData: LiveData<Drawable>, initialDrawable: Drawable? = null)

Properties

Link copied to clipboard
val liveData: LiveData<Drawable>

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
open override fun canApplyTheme(): Boolean
Link copied to clipboard
open fun clearColorFilter()
Link copied to clipboard
fun copyBounds(): Rect
fun copyBounds(p0: Rect)
Link copied to clipboard
open override fun draw(p0: Canvas)
Link copied to clipboard
open override fun getAlpha(): Int
Link copied to clipboard
fun getBounds(): Rect
Link copied to clipboard
open fun getCallback(): Drawable.Callback?
Link copied to clipboard
open override fun getChangingConfigurations(): Int
Link copied to clipboard
open override fun getColorFilter(): ColorFilter?
Link copied to clipboard
open override fun getConstantState(): Drawable.ConstantState?
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
open fun getLayoutDirection(): Int
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
open fun getTransparentRegion(): Region?
Link copied to clipboard
open override fun hasFocusStateSpecified(): Boolean
Link copied to clipboard
open fun inflate(p0: Resources, p1: XmlPullParser, p2: AttributeSet)
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
open fun isAutoMirrored(): Boolean
Link copied to clipboard
open fun isFilterBitmap(): Boolean
Link copied to clipboard
open fun isProjected(): Boolean
Link copied to clipboard
open override fun isStateful(): Boolean
Link copied to clipboard
fun isVisible(): Boolean
Link copied to clipboard
open override fun jumpToCurrentState()
Link copied to clipboard
open override fun mutate(): Drawable
Link copied to clipboard
open override fun onBoundsChange(p0: Rect)
Link copied to clipboard
open override fun onLayoutDirectionChanged(p0: Int): Boolean
Link copied to clipboard
open override fun onLevelChange(p0: Int): Boolean
Link copied to clipboard
open override fun onStateChange(p0: IntArray): 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
fun setCallback(p0: Drawable.Callback?)
Link copied to clipboard
open fun setChangingConfigurations(p0: Int)
Link copied to clipboard
open override fun setColorFilter(p0: ColorFilter?)
open fun setColorFilter(p0: Int, p1: PorterDuff.Mode)
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
fun setLayoutDirection(p0: Int): Boolean
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
open fun setTintMode(p0: PorterDuff.Mode?)
Link copied to clipboard
open override fun unscheduleDrawable(p0: Drawable, p1: Runnable)
Link copied to clipboard
open fun unscheduleSelf(p0: Runnable)

Inheritors

Link copied to clipboard