CompositeDrawable

open class CompositeDrawable : Drawable, Callback
kotlin.Any
   ↳ android.graphics.drawable.Drawable
   ↳ androidx.leanback.graphics.CompositeDrawable

Generic drawable class that can be composed of multiple children. Whenever the bounds changes for this class, it updates those of its children.

Summary

Nested classes

Wrapper class holding a drawable object and BoundsRule to update drawable bounds when parent bound changes.

Public constructors

Public methods

open Unit

Adds the supplied region.

open Unit
draw(canvas: Canvas!)

open Int

open CompositeDrawable.ChildDrawable!
getChildAt(index: Int)

Returns the ChildDrawable at the given index.

open Int

Returns the total number of children.

open ConstantState!

open Drawable!
getDrawable(index: Int)

Returns the Drawable for the given index.

open Int

open Unit

open Drawable!

open Unit
removeChild(index: Int)

Removes the child corresponding to the given index.

open Unit

Removes the given region.

open Unit
scheduleDrawable(who: Drawable!, what: Runnable!, when: Long)

open Unit
setAlpha(alpha: Int)

open Unit
setChildDrawableAt(index: Int, drawable: Drawable!)

Sets the supplied region at given index.

open Unit
setColorFilter(colorFilter: ColorFilter!)

open Unit

Protected methods

open Unit
onBoundsChange(bounds: Rect!)

Public constructors

<init>

CompositeDrawable()

Public methods

addChildDrawable

open fun addChildDrawable(drawable: Drawable!): Unit

Adds the supplied region.

draw

open fun draw(canvas: Canvas!): Unit

getAlpha

open fun getAlpha(): Int
Return
Int: Alpha value between 0(inclusive) and 255(inclusive)

getChildAt

open fun getChildAt(index: Int): CompositeDrawable.ChildDrawable!

Returns the ChildDrawable at the given index.

getChildCount

open fun getChildCount(): Int

Returns the total number of children.

getConstantState

open fun getConstantState(): ConstantState!

getDrawable

open fun getDrawable(index: Int): Drawable!

Returns the Drawable for the given index.

getOpacity

open fun getOpacity(): Int

invalidateDrawable

open fun invalidateDrawable(who: Drawable!): Unit

mutate

open fun mutate(): Drawable!

removeChild

open fun removeChild(index: Int): Unit

Removes the child corresponding to the given index.

removeDrawable

open fun removeDrawable(drawable: Drawable!): Unit

Removes the given region.

scheduleDrawable

open fun scheduleDrawable(who: Drawable!, what: Runnable!, when: Long): Unit

setAlpha

open fun setAlpha(alpha: Int): Unit

setChildDrawableAt

open fun setChildDrawableAt(index: Int, drawable: Drawable!): Unit

Sets the supplied region at given index.

setColorFilter

open fun setColorFilter(colorFilter: ColorFilter!): Unit

unscheduleDrawable

open fun unscheduleDrawable(who: Drawable!, what: Runnable!): Unit

Protected methods

onBoundsChange

protected open fun onBoundsChange(bounds: Rect!): Unit