# CompositeDrawable.ChildDrawable

# CompositeDrawable.ChildDrawable

Artifact:[androidx.leanback:leanback](https://developer.android.com/jetpack/androidx/releases/leanback)  
[View Source](https://cs.android.com/search?q=file:androidx/leanback/graphics/CompositeDrawable.java+class:androidx.leanback.graphics.CompositeDrawable.ChildDrawable)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/leanback/graphics/CompositeDrawable.ChildDrawable "View this page in Java")

<br />

```
class CompositeDrawable.ChildDrawable
```

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                                         ### Constants                                                                                                                                                          |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable)`!, `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`!>!`     | [BOTTOM_ABSOLUTE](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable#BOTTOM_ABSOLUTE()) Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overrideBottom attribute.                                                                                                                                                                                                                                                            |
| `const `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable)`!, `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`!>!` | [BOTTOM_FRACTION](https://developer.android.com/reference/kotlin/androidx/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/kotlin/androidx/leanback/graphics/BoundsRule)associated with this[ChildDrawable](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable). |
| `const `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable)`!, `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`!>!`     | [LEFT_ABSOLUTE](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable#LEFT_ABSOLUTE()) Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overrideLeft attribute.                                                                                                                                                                                                                                                                  |
| `const `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable)`!, `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`!>!` | [LEFT_FRACTION](https://developer.android.com/reference/kotlin/androidx/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/kotlin/androidx/leanback/graphics/BoundsRule)associated with this[ChildDrawable](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable).     |
| `const `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable)`!, `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`!>!`     | [RIGHT_ABSOLUTE](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable#RIGHT_ABSOLUTE()) Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overrideRight attribute.                                                                                                                                                                                                                                                               |
| `const `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable)`!, `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`!>!` | [RIGHT_FRACTION](https://developer.android.com/reference/kotlin/androidx/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/kotlin/androidx/leanback/graphics/BoundsRule)associated with this[ChildDrawable](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable).   |
| `const `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable)`!, `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`!>!`     | [TOP_ABSOLUTE](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable#TOP_ABSOLUTE()) Implementation of[Property](https://developer.android.com/reference/android/util/Property.html)for overrideTop attribute.                                                                                                                                                                                                                                                                     |
| `const `[Property](https://developer.android.com/reference/android/util/Property.html)`<`[CompositeDrawable.ChildDrawable](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable)`!, `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`!>!` | [TOP_FRACTION](https://developer.android.com/reference/kotlin/androidx/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/kotlin/androidx/leanback/graphics/BoundsRule)associated with this[ChildDrawable](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable).       |

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

|                                        ### Public functions                                        |
|----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [BoundsRule](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/BoundsRule) | [getBoundsRule](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable#getBoundsRule())`()` Returns the instance of[BoundsRule](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/BoundsRule).                                                                           |
| [Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html)        | [getDrawable](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable#getDrawable())`()` Returns the[Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html).                                                                                                  |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                      | [recomputeBounds](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/CompositeDrawable.ChildDrawable#recomputeBounds())`()` After changing the[BoundsRule](https://developer.android.com/reference/kotlin/androidx/leanback/graphics/BoundsRule), user should call this function for the drawable to recalculate its bounds. |

## Constants

### BOTTOM_ABSOLUTE

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)  

```
const val BOTTOM_ABSOLUTE: Property<CompositeDrawable.ChildDrawable!, Int!>!
```

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

### BOTTOM_FRACTION

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)  

```
const val BOTTOM_FRACTION: Property<CompositeDrawable.ChildDrawable!, Float!>!
```

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

### LEFT_ABSOLUTE

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)  

```
const val LEFT_ABSOLUTE: Property<CompositeDrawable.ChildDrawable!, Int!>!
```

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

### LEFT_FRACTION

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)  

```
const val LEFT_FRACTION: Property<CompositeDrawable.ChildDrawable!, Float!>!
```

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

### RIGHT_ABSOLUTE

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)  

```
const val RIGHT_ABSOLUTE: Property<CompositeDrawable.ChildDrawable!, Int!>!
```

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

### RIGHT_FRACTION

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)  

```
const val RIGHT_FRACTION: Property<CompositeDrawable.ChildDrawable!, Float!>!
```

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

### TOP_ABSOLUTE

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)  

```
const val TOP_ABSOLUTE: Property<CompositeDrawable.ChildDrawable!, Int!>!
```

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

### TOP_FRACTION

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)  

```
const val TOP_FRACTION: Property<CompositeDrawable.ChildDrawable!, Float!>!
```

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

## Public constructors

### ChildDrawable

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)  

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

## Public functions

### getBoundsRule

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)  

```
fun getBoundsRule(): BoundsRule
```

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

### getDrawable

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)  

```
fun getDrawable(): Drawable
```

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

### recomputeBounds

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)  

```
fun recomputeBounds(): Unit
```

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