# 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)

*** ** * ** ***


```
public final class CompositeDrawable.ChildDrawable
```

<br />

*** ** * ** ***

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

## Summary

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

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/leanback/graphics/CompositeDrawable.ChildDrawable#ChildDrawable(android.graphics.drawable.Drawable,androidx.leanback.graphics.CompositeDrawable)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/drawable/Drawable.html drawable, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/leanback/graphics/CompositeDrawable parent )` |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/leanback/graphics/BoundsRule` | `https://developer.android.com/reference/androidx/leanback/graphics/CompositeDrawable.ChildDrawable#getBoundsRule()()` Returns the instance of `https://developer.android.com/reference/androidx/leanback/graphics/BoundsRule`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/drawable/Drawable.html` | `https://developer.android.com/reference/androidx/leanback/graphics/CompositeDrawable.ChildDrawable#getDrawable()()` Returns the `https://developer.android.com/reference/android/graphics/drawable/Drawable.html`. |
| `void` | `https://developer.android.com/reference/androidx/leanback/graphics/CompositeDrawable.ChildDrawable#recomputeBounds()()` After changing the `https://developer.android.com/reference/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)

```
public static final Property<CompositeDrawable.ChildDrawable, Integer> BOTTOM_ABSOLUTE
```

Implementation of `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)

```
public static final Property<CompositeDrawable.ChildDrawable, Float> BOTTOM_FRACTION
```

Implementation of `https://developer.android.com/reference/android/util/Property.html` for overwriting the bottom attribute of `https://developer.android.com/reference/androidx/leanback/graphics/BoundsRule` associated with this `https://developer.android.com/reference/androidx/leanback/graphics/CompositeDrawable.ChildDrawable`. This allows users to change the bounds rules as a percentage of parent size. This is preferable over `https://developer.android.com/reference/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)

```
public static final Property<CompositeDrawable.ChildDrawable, Integer> LEFT_ABSOLUTE
```

Implementation of `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)

```
public static final Property<CompositeDrawable.ChildDrawable, Float> LEFT_FRACTION
```

Implementation of `https://developer.android.com/reference/android/util/Property.html` for overwriting the bottom attribute of `https://developer.android.com/reference/androidx/leanback/graphics/BoundsRule` associated with this `https://developer.android.com/reference/androidx/leanback/graphics/CompositeDrawable.ChildDrawable`. This allows users to change the bounds rules as a percentage of parent size. This is preferable over `https://developer.android.com/reference/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)

```
public static final Property<CompositeDrawable.ChildDrawable, Integer> RIGHT_ABSOLUTE
```

Implementation of `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)

```
public static final Property<CompositeDrawable.ChildDrawable, Float> RIGHT_FRACTION
```

Implementation of `https://developer.android.com/reference/android/util/Property.html` for overwriting the bottom attribute of `https://developer.android.com/reference/androidx/leanback/graphics/BoundsRule` associated with this `https://developer.android.com/reference/androidx/leanback/graphics/CompositeDrawable.ChildDrawable`. This allows users to change the bounds rules as a percentage of parent size. This is preferable over `https://developer.android.com/reference/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)

```
public static final Property<CompositeDrawable.ChildDrawable, Integer> TOP_ABSOLUTE
```

Implementation of `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)

```
public static final Property<CompositeDrawable.ChildDrawable, Float> TOP_FRACTION
```

Implementation of `https://developer.android.com/reference/android/util/Property.html` for overwriting the bottom attribute of `https://developer.android.com/reference/androidx/leanback/graphics/BoundsRule` associated with this `https://developer.android.com/reference/androidx/leanback/graphics/CompositeDrawable.ChildDrawable`. This allows users to change the bounds rules as a percentage of parent size. This is preferable over `https://developer.android.com/reference/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)

```
public ChildDrawable(
    @NonNull Drawable drawable,
    @NonNull CompositeDrawable parent
)
```

## Public methods

### getBoundsRule

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

```
public @NonNull BoundsRule getBoundsRule()
```

Returns the instance of `https://developer.android.com/reference/androidx/leanback/graphics/BoundsRule`.

### getDrawable

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

```
public @NonNull Drawable getDrawable()
```

Returns the `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)

```
public void recomputeBounds()
```

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