# CompositeDrawable.ChildDrawable

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1  
Summary:[Fields](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#lfields)\|[Ctors](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#pubctors)\|[Methods](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#)  

# CompositeDrawable.ChildDrawable

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public
static
final

class
CompositeDrawable.ChildDrawable
`  
`

extends Object


``


`

|---|-----------------------------------------------------------------------|
| java.lang.Object                                                         ||
| ↳ | android.support.v17.leanback.graphics.CompositeDrawable.ChildDrawable |

<br />

*** ** * ** ***

Wrapper class holding a drawable object and[BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule)to update drawable bounds when parent bound changes.

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                ### Fields                                                                                                                                                                                                                                                                                                                                                                                                                ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` public static final `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable)`, Integer>` | [BOTTOM_ABSOLUTE](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#BOTTOM_ABSOLUTE) Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overrideBottom attribute.                                                                                                                                                                                                                                                                                      |
| ` public static final `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable)`, Float>`   | [BOTTOM_FRACTION](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#BOTTOM_FRACTION) Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overwriting the bottom attribute of[BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule)associated with this[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable). |
| ` public static final `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable)`, Integer>` | [LEFT_ABSOLUTE](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#LEFT_ABSOLUTE) Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overrideLeft attribute.                                                                                                                                                                                                                                                                                            |
| ` public static final `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable)`, Float>`   | [LEFT_FRACTION](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#LEFT_FRACTION) Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overwriting the bottom attribute of[BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule)associated with this[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable).     |
| ` public static final `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable)`, Integer>` | [RIGHT_ABSOLUTE](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#RIGHT_ABSOLUTE) Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overrideRight attribute.                                                                                                                                                                                                                                                                                         |
| ` public static final `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable)`, Float>`   | [RIGHT_FRACTION](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#RIGHT_FRACTION) Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overwriting the bottom attribute of[BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule)associated with this[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable).   |
| ` public static final `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable)`, Integer>` | [TOP_ABSOLUTE](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#TOP_ABSOLUTE) Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overrideTop attribute.                                                                                                                                                                                                                                                                                               |
| ` public static final `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable)`, Float>`   | [TOP_FRACTION](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#TOP_FRACTION) Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overwriting the bottom attribute of[BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule)associated with this[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable).       |

|                                                                                                                                                                                                                                                    ### Public constructors                                                                                                                                                                                                                                                    ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#CompositeDrawable.ChildDrawable(android.graphics.drawable.Drawable, android.support.v17.leanback.graphics.CompositeDrawable))`(`[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html)` drawable, `[CompositeDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable)` parent) ` |

|                                                                                                                                                                                                                             ### Public methods                                                                                                                                                                                                                             ||
|-----------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule) | ` `[getBoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#getBoundsRule())`() ` Returns the instance of[BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule).                                                                           |
| ` `[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html)            | ` `[getDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#getDrawable())`() ` Returns the[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html).                                                                                                      |
| ` void`                                                                                                   | ` `[recomputeBounds](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#recomputeBounds())`() ` After changing the[BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule), user should call this function for the drawable to recalculate its bounds. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Fields

### BOTTOM_ABSOLUTE

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Property<CompositeDrawable.ChildDrawable, Integer> BOTTOM_ABSOLUTE
```

Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overrideBottom attribute.

<br />

### BOTTOM_FRACTION

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Property<CompositeDrawable.ChildDrawable, Float> BOTTOM_FRACTION
```

Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overwriting the bottom attribute of[BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule)associated with this[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable). This allows users to change the bounds rules as a percentage of parent size. This is preferable over when the exact start/end position of scroll movement isn't available at compile time.

<br />

**See also:**

- [ERROR(/PROPERTY_BOTTOM_ABSOLUTE)](https://developer.android.com/)  

### LEFT_ABSOLUTE

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Property<CompositeDrawable.ChildDrawable, Integer> LEFT_ABSOLUTE
```

Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overrideLeft attribute.

<br />

### LEFT_FRACTION

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Property<CompositeDrawable.ChildDrawable, Float> LEFT_FRACTION
```

Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overwriting the bottom attribute of[BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule)associated with this[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable). This allows users to change the bounds rules as a percentage of parent size. This is preferable over when the exact start/end position of scroll movement isn't available at compile time.

<br />

**See also:**

- [ERROR(/PROPERTY_LEFT_ABSOLUTE)](https://developer.android.com/)  

### RIGHT_ABSOLUTE

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Property<CompositeDrawable.ChildDrawable, Integer> RIGHT_ABSOLUTE
```

Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overrideRight attribute.

<br />

### RIGHT_FRACTION

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Property<CompositeDrawable.ChildDrawable, Float> RIGHT_FRACTION
```

Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overwriting the bottom attribute of[BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule)associated with this[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable). This allows users to change the bounds rules as a percentage of parent size. This is preferable over when the exact start/end position of scroll movement isn't available at compile time.

<br />

**See also:**

- [ERROR(/PROPERTY_RIGHT_ABSOLUTE)](https://developer.android.com/)  

### TOP_ABSOLUTE

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Property<CompositeDrawable.ChildDrawable, Integer> TOP_ABSOLUTE
```

Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overrideTop attribute.

<br />

### TOP_FRACTION

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Property<CompositeDrawable.ChildDrawable, Float> TOP_FRACTION
```

Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overwriting the bottom attribute of[BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule)associated with this[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable). This allows users to change the bounds rules as a percentage of parent size. This is preferable over when the exact start/end position of scroll movement isn't available at compile time.

<br />

**See also:**

- [ERROR(/PROPERTY_TOP_ABSOLUTE)](https://developer.android.com/)

## Public constructors

### CompositeDrawable.ChildDrawable

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
CompositeDrawable.ChildDrawable (Drawable drawable, 
                CompositeDrawable parent)
```

<br />

<br />

|               Parameters               ||
|------------|----------------------------|
| `drawable` | `Drawable` <br />          |
| `parent`   | `CompositeDrawable` <br /> |

## Public methods

### getBoundsRule

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
BoundsRule getBoundsRule ()
```

Returns the instance of[BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule).

<br />

|                                                    Returns                                                     ||
|--------------------------------------------------------------------------------------------------------|--------|
| [BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule) | <br /> |

### getDrawable

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Drawable getDrawable ()
```

Returns the[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html).

<br />

|                                               Returns                                               ||
|---------------------------------------------------------------------------------------------|--------|
| [Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html) | <br /> |

### recomputeBounds

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void recomputeBounds ()
```

After changing the[BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule), user should call this function for the drawable to recalculate its bounds.

<br />

-

  ## Classes

  - [BoundsRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule)
  - [BoundsRule.ValueRule](https://developer.android.com/reference/android/support/v17/leanback/graphics/BoundsRule.ValueRule)
  - [ColorFilterCache](https://developer.android.com/reference/android/support/v17/leanback/graphics/ColorFilterCache)
  - [ColorFilterDimmer](https://developer.android.com/reference/android/support/v17/leanback/graphics/ColorFilterDimmer)
  - [ColorOverlayDimmer](https://developer.android.com/reference/android/support/v17/leanback/graphics/ColorOverlayDimmer)
  - [CompositeDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable)
  - [CompositeDrawable.ChildDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/CompositeDrawable.ChildDrawable)
  - [FitWidthBitmapDrawable](https://developer.android.com/reference/android/support/v17/leanback/graphics/FitWidthBitmapDrawable)