Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

DrawableContainer.DrawableContainerState

public static abstract class DrawableContainer.DrawableContainerState
extends Drawable.ConstantState

java.lang.Object
   ↳ android.graphics.drawable.Drawable.ConstantState
     ↳ android.graphics.drawable.DrawableContainer.DrawableContainerState


A ConstantState that can contain several Drawables. This class was made public to enable testing, and its visibility may change in a future release.

Summary

Public methods

final int addChild(Drawable dr)

Adds the drawable to the end of the list of contained drawables.

boolean canApplyTheme()

Return whether this constant state can have a theme applied.

boolean canConstantState()
int getChangingConfigurations()

Return a bit mask of configuration changes that will impact this drawable (and thus require completely reloading it).

final Drawable getChild(int index)
final int getChildCount()
final Drawable[] getChildren()
final int getConstantHeight()
final int getConstantMinimumHeight()
final int getConstantMinimumWidth()
final Rect getConstantPadding()
final int getConstantWidth()
final int getEnterFadeDuration()
final int getExitFadeDuration()
final int getOpacity()
void growArray(int oldSize, int newSize)
final boolean isConstantSize()
final boolean isStateful()
final void setConstantSize(boolean constant)
final void setEnterFadeDuration(int duration)
final void setExitFadeDuration(int duration)
final void setVariablePadding(boolean variable)

A boolean value indicating whether to use the maximum padding value of all frames in the set (false), or to use the padding value of the frame being shown (true).

Protected methods

void computeConstantSize()

Inherited methods

Public methods

addChild

added in API level 1
public final int addChild (Drawable dr)

Adds the drawable to the end of the list of contained drawables.

Parameters
dr Drawable: the drawable to add

Returns
int the position of the drawable within the container

canApplyTheme

added in API level 21
public boolean canApplyTheme ()

Return whether this constant state can have a theme applied.

Returns
boolean

canConstantState

added in API level 1
public boolean canConstantState ()

Returns
boolean

getChangingConfigurations

added in API level 1
public int getChangingConfigurations ()

Return a bit mask of configuration changes that will impact this drawable (and thus require completely reloading it).

Returns
int

Value is either 0 or combination of CONFIG_MCC, CONFIG_MNC, CONFIG_LOCALE, CONFIG_TOUCHSCREEN, CONFIG_KEYBOARD, CONFIG_KEYBOARD_HIDDEN, CONFIG_NAVIGATION, CONFIG_ORIENTATION, CONFIG_SCREEN_LAYOUT, CONFIG_UI_MODE, CONFIG_SCREEN_SIZE, CONFIG_SMALLEST_SCREEN_SIZE, CONFIG_DENSITY, CONFIG_LAYOUT_DIRECTION, CONFIG_COLOR_MODE or CONFIG_FONT_SCALE.

getChild

added in API level 19
public final Drawable getChild (int index)

Parameters
index int

Returns
Drawable

getChildCount

added in API level 1
public final int getChildCount ()

Returns
int

getChildren

added in API level 1
public final Drawable[] getChildren ()

Returns
Drawable[]

getConstantHeight

added in API level 1
public final int getConstantHeight ()

Returns
int

getConstantMinimumHeight

added in API level 1
public final int getConstantMinimumHeight ()

Returns
int

getConstantMinimumWidth

added in API level 1
public final int getConstantMinimumWidth ()

Returns
int

getConstantPadding

added in API level 1
public final Rect getConstantPadding ()

Returns
Rect

getConstantWidth

added in API level 1
public final int getConstantWidth ()

Returns
int

getEnterFadeDuration

added in API level 11
public final int getEnterFadeDuration ()

Returns
int

getExitFadeDuration

added in API level 11
public final int getExitFadeDuration ()

Returns
int

getOpacity

added in API level 1
public final int getOpacity ()

Returns
int

growArray

added in API level 1
public void growArray (int oldSize, 
                int newSize)

Parameters
oldSize int

newSize int

isConstantSize

added in API level 1
public final boolean isConstantSize ()

Returns
boolean

isStateful

added in API level 1
public final boolean isStateful ()

Returns
boolean

setConstantSize

added in API level 1
public final void setConstantSize (boolean constant)

Parameters
constant boolean

setEnterFadeDuration

added in API level 11
public final void setEnterFadeDuration (int duration)

Parameters
duration int

setExitFadeDuration

added in API level 11
public final void setExitFadeDuration (int duration)

Parameters
duration int

setVariablePadding

added in API level 1
public final void setVariablePadding (boolean variable)

A boolean value indicating whether to use the maximum padding value of all frames in the set (false), or to use the padding value of the frame being shown (true). Default value is false.

Parameters
variable boolean

Protected methods

computeConstantSize

added in API level 11
protected void computeConstantSize ()