Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#pubmethods) \| [Protected Methods](https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#promethods) \| [Inherited Methods](https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#inhmethods)

# DrawableContainer.DrawableContainerState

*** ** * ** ***


`
public
static

abstract
class
DrawableContainer.DrawableContainerState
`


`


`

`

extends https://developer.android.com/reference/android/graphics/drawable/Drawable.ConstantState


`

`


`

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.graphics.drawable.Drawable.ConstantState](https://developer.android.com/reference/android/graphics/drawable/Drawable.ConstantState) ||
|   | ↳ | android.graphics.drawable.DrawableContainer.DrawableContainerState |

<br />

*** ** * ** ***

A ConstantState that can contain several `https://developer.android.com/reference/android/graphics/drawable/Drawable`s.

This class was made public to enable testing, and its visibility may change in a future
release.

## Summary

| ### Public methods ||
|---|---|
| ` final int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#addChild(android.graphics.drawable.Drawable)(https://developer.android.com/reference/android/graphics/drawable/Drawable dr) ` Adds the drawable to the end of the list of contained drawables. |
| ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#canApplyTheme()() ` Return whether this constant state can have a theme applied. |
| ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#canConstantState()() ` |
| ` int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#getChangingConfigurations()() ` Return a bit mask of configuration changes that will impact this drawable (and thus require completely reloading it). |
| ` final https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#getChild(int)(int index) ` |
| ` final int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#getChildCount()() ` |
| ` final https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#getChildren()() ` |
| ` final int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#getConstantHeight()() ` |
| ` final int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#getConstantMinimumHeight()() ` |
| ` final int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#getConstantMinimumWidth()() ` |
| ` final https://developer.android.com/reference/android/graphics/Rect` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#getConstantPadding()() ` |
| ` final int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#getConstantWidth()() ` |
| ` final int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#getEnterFadeDuration()() ` |
| ` final int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#getExitFadeDuration()() ` |
| ` final int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#getOpacity()() ` |
| ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#growArray(int,%20int)(int oldSize, int newSize) ` |
| ` final boolean` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#isConstantSize()() ` |
| ` final boolean` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#isStateful()() ` |
| ` final void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#setConstantSize(boolean)(boolean constant) ` |
| ` final void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#setEnterFadeDuration(int)(int duration) ` |
| ` final void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#setExitFadeDuration(int)(int duration) ` |
| ` final void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#setVariablePadding(boolean)(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` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState#computeConstantSize()() ` |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/android/graphics/drawable/Drawable.ConstantState ` |---|---| | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable.ConstantState#canApplyTheme()() ` Return whether this constant state can have a theme applied. | | ` abstract int` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable.ConstantState#getChangingConfigurations()() ` Return a bit mask of configuration changes that will impact this drawable (and thus require completely reloading it). | | ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable.ConstantState#newDrawable(android.content.res.Resources)(https://developer.android.com/reference/android/content/res/Resources res) ` Creates a new Drawable instance from its constant state using the specified resources. | | ` abstract https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable.ConstantState#newDrawable()() ` Creates a new Drawable instance from its constant state. | | ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable.ConstantState#newDrawable(android.content.res.Resources,%20android.content.res.Resources.Theme)(https://developer.android.com/reference/android/content/res/Resources res, https://developer.android.com/reference/android/content/res/Resources.Theme theme) ` Creates a new Drawable instance from its constant state using the specified resources and theme. | ||
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public methods

### addChild

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final int addChild (Drawable dr)
```

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

<br />

| Parameters ||
|---|---|
| `dr` | `Drawable`: the drawable to add <br /> |

| Returns ||
|---|---|
| `int` | the position of the drawable within the container <br /> |

### canApplyTheme

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean canApplyTheme ()
```

Return whether this constant state can have a theme applied.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### canConstantState

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean canConstantState ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### getChangingConfigurations

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getChangingConfigurations ()
```

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

<br />

| Returns ||
|---|---|
| `int` | Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_MCC` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_MNC` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_LOCALE` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_TOUCHSCREEN` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_KEYBOARD` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_KEYBOARD_HIDDEN` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_NAVIGATION` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_ORIENTATION` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_SCREEN_LAYOUT` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_UI_MODE` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_SCREEN_SIZE` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_SMALLEST_SCREEN_SIZE` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_DENSITY` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_LAYOUT_DIRECTION` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_COLOR_MODE` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_FONT_SCALE` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_GRAMMATICAL_GENDER` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_FONT_WEIGHT_ADJUSTMENT` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_ASSETS_PATHS` - `https://developer.android.com/reference/android/content/pm/ActivityInfo#CONFIG_RESOURCES_UNUSED` |

### getChild

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final Drawable getChild (int index)
```

<br />

<br />

| Parameters ||
|---|---|
| `index` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable` | <br /> |

### getChildCount

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final int getChildCount ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getChildren

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final Drawable[] getChildren ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable` | <br /> |

### getConstantHeight

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final int getConstantHeight ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getConstantMinimumHeight

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final int getConstantMinimumHeight ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getConstantMinimumWidth

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final int getConstantMinimumWidth ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getConstantPadding

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final Rect getConstantPadding ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Rect` | <br /> |

### getConstantWidth

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final int getConstantWidth ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getEnterFadeDuration

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final int getEnterFadeDuration ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getExitFadeDuration

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final int getExitFadeDuration ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getOpacity

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final int getOpacity ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### growArray

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void growArray (int oldSize, 
                int newSize)
```

<br />

<br />

| Parameters ||
|---|---|
| `oldSize` | `int` <br /> |
| `newSize` | `int` <br /> |

### isConstantSize

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final boolean isConstantSize ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isStateful

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final boolean isStateful ()
```

<br />

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### setConstantSize

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final void setConstantSize (boolean constant)
```

<br />

<br />

| Parameters ||
|---|---|
| `constant` | `boolean` <br /> |

### setEnterFadeDuration

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final void setEnterFadeDuration (int duration)
```

<br />

<br />

| Parameters ||
|---|---|
| `duration` | `int` <br /> |

### setExitFadeDuration

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final void setExitFadeDuration (int duration)
```

<br />

<br />

| Parameters ||
|---|---|
| `duration` | `int` <br /> |

### setVariablePadding

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Parameters ||
|---|---|
| `variable` | `boolean` <br /> |

## Protected methods

### computeConstantSize

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void computeConstantSize ()
```

<br />

<br />