CompositeDrawable
class CompositeDrawable : Drawable, Drawable.Callback
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 types |
|---|
|
Wrapper class holding a drawable object and |
Public constructors |
|---|
Public functions |
|
|---|---|
Unit |
addChildDrawable(drawable: Drawable)Adds the supplied region. |
Unit |
|
Int |
getAlpha() |
CompositeDrawable.ChildDrawable |
getChildAt(index: Int)Returns the |
Int |
Returns the total number of children. |
Drawable.ConstantState |
|
Drawable |
getDrawable(index: Int)Returns the |
Int |
This function is deprecated. |
Unit |
invalidateDrawable(who: Drawable) |
Drawable |
mutate() |
Unit |
removeChild(index: Int)Removes the child corresponding to the given index. |
Unit |
removeDrawable(drawable: Drawable)Removes the given region. |
Unit |
scheduleDrawable(who: Drawable, what: Runnable, when: Long) |
Unit |
|
Unit |
setChildDrawableAt(index: Int, drawable: Drawable)Sets the supplied region at given index. |
Unit |
setColorFilter(colorFilter: ColorFilter?) |
Unit |
unscheduleDrawable(who: Drawable, what: Runnable) |
Protected functions |
|
|---|---|
Unit |
onBoundsChange(bounds: Rect!) |
Public constructors
Public functions
addChildDrawable
fun addChildDrawable(drawable: Drawable): Unit
Adds the supplied region.
getChildAt
fun getChildAt(index: Int): CompositeDrawable.ChildDrawable
Returns the ChildDrawable at the given index.
getDrawable
fun getDrawable(index: Int): Drawable
Returns the Drawable for the given index.
removeChild
fun removeChild(index: Int): Unit
Removes the child corresponding to the given index.
removeDrawable
fun removeDrawable(drawable: Drawable): Unit
Removes the given region.
scheduleDrawable
fun scheduleDrawable(who: Drawable, what: Runnable, when: Long): Unit
setChildDrawableAt
fun setChildDrawableAt(index: Int, drawable: Drawable): Unit
Sets the supplied region at given index.