DrawableContainerCompat


class DrawableContainerCompat : Drawable, Drawable.Callback

Known direct subclasses
StateListDrawableCompat

Lets you assign a number of graphic images to a single Drawable and swap out the visible item by a string ID value.

Known indirect subclasses
AnimatedStateListDrawableCompat

A Drawable providing animated transitions between states.


A helper class that contains several Drawables and selects which one to use.

Adapted from platform class, altered with API level checks as necessary.

Summary

Public constructors

Public functions

Unit
@RequiresApi(value = 21)
applyTheme(theme: Resources.Theme)
Boolean
@RequiresApi(value = 21)
canApplyTheme()
Unit
draw(canvas: Canvas)
Int
Int
Drawable.ConstantState!
Drawable
Unit
Int
Int
Int
Int
Int

This function is deprecated.

Unit
@RequiresApi(value = 21)
getOutline(outline: Outline)
Boolean
getPadding(padding: Rect)
Unit
Boolean
Boolean
Unit
Drawable!
Boolean
onLayoutDirectionChanged(layoutDirection: Int)
Unit
scheduleDrawable(who: Drawable, what: Runnable, when: Long)
Unit
setAlpha(alpha: Int)
Unit
Unit
setColorFilter(colorFilter: ColorFilter!)
Unit
setDither(dither: Boolean)

This function is deprecated.

Unit

Change the global fade duration when a new drawable is entering the scene.

Unit

Change the global fade duration when a new drawable is leaving the scene.

Unit
Unit
setHotspotBounds(left: Int, top: Int, right: Int, bottom: Int)
Unit
setTint(tintColor: @ColorInt Int)
Unit
Unit
Boolean
setVisible(visible: Boolean, restart: Boolean)
Unit

Protected functions

Unit
onBoundsChange(bounds: Rect!)
Boolean
Boolean

Inherited functions

From android.graphics.drawable.Drawable

Public constructors

DrawableContainerCompat

Added in 1.6.0
DrawableContainerCompat()

Public functions

applyTheme

@RequiresApi(value = 21)
fun applyTheme(theme: Resources.Theme): Unit

canApplyTheme

@RequiresApi(value = 21)
fun canApplyTheme(): Boolean

draw

Added in 1.6.0
fun draw(canvas: Canvas): Unit

getAlpha

fun getAlpha(): Int

getChangingConfigurations

fun getChangingConfigurations(): Int

getConstantState

Added in 1.6.0
fun getConstantState(): Drawable.ConstantState!

getCurrent

fun getCurrent(): Drawable

getHotspotBounds

fun getHotspotBounds(outRect: Rect): Unit

getIntrinsicHeight

fun getIntrinsicHeight(): Int

getIntrinsicWidth

fun getIntrinsicWidth(): Int

getMinimumHeight

fun getMinimumHeight(): Int

getMinimumWidth

fun getMinimumWidth(): Int

getOpacity

Added in 1.6.0
fun getOpacity(): Int

getOutline

@RequiresApi(value = 21)
fun getOutline(outline: Outline): Unit

getPadding

fun getPadding(padding: Rect): Boolean

invalidateDrawable

Added in 1.6.0
fun invalidateDrawable(who: Drawable): Unit

isAutoMirrored

fun isAutoMirrored(): Boolean

isStateful

fun isStateful(): Boolean

jumpToCurrentState

fun jumpToCurrentState(): Unit

mutate

fun mutate(): Drawable!

onLayoutDirectionChanged

fun onLayoutDirectionChanged(layoutDirection: Int): Boolean

scheduleDrawable

Added in 1.6.0
fun scheduleDrawable(who: Drawable, what: Runnable, when: Long): Unit

setAlpha

Added in 1.6.0
fun setAlpha(alpha: Int): Unit

setAutoMirrored

fun setAutoMirrored(mirrored: Boolean): Unit

setColorFilter

Added in 1.6.0
fun setColorFilter(colorFilter: ColorFilter!): Unit

setDither

Added in 1.6.0
fun setDither(dither: Boolean): Unit

setEnterFadeDuration

Added in 1.6.0
fun setEnterFadeDuration(ms: Int): Unit

Change the global fade duration when a new drawable is entering the scene.

Parameters
ms: Int

The amount of time to fade in milliseconds.

setExitFadeDuration

Added in 1.6.0
fun setExitFadeDuration(ms: Int): Unit

Change the global fade duration when a new drawable is leaving the scene.

Parameters
ms: Int

The amount of time to fade in milliseconds.

setHotspot

fun setHotspot(x: Float, y: Float): Unit

setHotspotBounds

fun setHotspotBounds(left: Int, top: Int, right: Int, bottom: Int): Unit

setTint

fun setTint(tintColor: @ColorInt Int): Unit

setTintList

fun setTintList(tint: ColorStateList!): Unit

setTintMode

fun setTintMode(tintMode: PorterDuff.Mode): Unit

setVisible

fun setVisible(visible: Boolean, restart: Boolean): Boolean

unscheduleDrawable

Added in 1.6.0
fun unscheduleDrawable(who: Drawable, what: Runnable): Unit

Protected functions

onBoundsChange

protected fun onBoundsChange(bounds: Rect!): Unit

onLevelChange

protected fun onLevelChange(level: Int): Boolean

onStateChange

protected fun onStateChange(state: IntArray): Boolean