# WindowInsetsAnimation.Bounds

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

# Bounds

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/view/WindowInsetsAnimation.Bounds "View this page in Java")  

```
class Bounds
```

|---|----------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                         ||
| ↳ | [android.view.WindowInsetsAnimation.Bounds](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimation.Bounds#) |

Class representing the range of an[WindowInsetsAnimation](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimation)

## Summary

|                                                                                                                                                                                    Public constructors                                                                                                                                                                                    ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Bounds](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimation.Bounds#Bounds(android.graphics.Insets,%20android.graphics.Insets))`(`lowerBound:` `[Insets](https://developer.android.com/reference/kotlin/android/graphics/Insets.html#)`, `upperBound:` `[Insets](https://developer.android.com/reference/kotlin/android/graphics/Insets.html#)`)` <br /> |

|                                                                                                                                                                                                          Public methods                                                                                                                                                                                                          ||
|---------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Insets](https://developer.android.com/reference/kotlin/android/graphics/Insets.html#)                                    | [getLowerBound](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimation.Bounds#getLowerBound())`()` Queries the lower inset bound of the animation.                                                                                                                         |
| [Insets](https://developer.android.com/reference/kotlin/android/graphics/Insets.html#)                                    | [getUpperBound](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimation.Bounds#getUpperBound())`()` Queries the upper inset bound of the animation.                                                                                                                         |
| [WindowInsetsAnimation.Bounds](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimation.Bounds#) | [inset](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimation.Bounds#inset(android.graphics.Insets))`(`insets:` `[Insets](https://developer.android.com/reference/kotlin/android/graphics/Insets.html#)`)` Insets both the lower and upper bound by the specified insets. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                          | [toString](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimation.Bounds#toString())`()` <br />                                                                                                                                                                            |

## Public constructors

### Bounds

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

```
Bounds(
    lowerBound: Insets, 
    upperBound: Insets)
```

|                                                            Parameters                                                            ||
|--------------|--------------------------------------------------------------------------------------------------------------------|
| `lowerBound` | [Insets](https://developer.android.com/reference/kotlin/android/graphics/Insets.html#):This value cannot be`null`. |
| `upperBound` | [Insets](https://developer.android.com/reference/kotlin/android/graphics/Insets.html#):This value cannot be`null`. |

## Public methods

### getLowerBound

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

```
fun getLowerBound(): Insets
```

Queries the lower inset bound of the animation. If the animation is about showing or hiding a window that cause insets, the lower bound is[Insets.NONE](https://developer.android.com/reference/kotlin/android/graphics/Insets.html#NONE:android.graphics.Insets)and the upper bound is the same as[WindowInsets.getInsets(int)](https://developer.android.com/reference/kotlin/android/view/WindowInsets#getInsets(kotlin.Int))for the fully shown state. This is the same as[WindowInsetsAnimationController.getHiddenStateInsets](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimationController#getHiddenStateInsets())and[WindowInsetsAnimationController.getShownStateInsets](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimationController#getShownStateInsets())in case the listener gets invoked because of an animation that originates from[WindowInsetsAnimationController](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimationController).

However, if the size of a window that causes insets is changing, these are the lower/upper bounds of that size animation.
There are no overlapping animations for a specific type, but there may be multiple animations running at the same time for different inset types.

|                                                       Return                                                        ||
|----------------------------------------------------------------------------------------|-----------------------------|
| [Insets](https://developer.android.com/reference/kotlin/android/graphics/Insets.html#) | This value cannot be`null`. |

**See Also**

- <https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimation.Bounds#getUpperBound()>
- [android.view.WindowInsetsAnimationController#getHiddenStateInsets](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimationController#getHiddenStateInsets())  

### getUpperBound

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

```
fun getUpperBound(): Insets
```

Queries the upper inset bound of the animation. If the animation is about showing or hiding a window that cause insets, the lower bound is[Insets.NONE](https://developer.android.com/reference/kotlin/android/graphics/Insets.html#NONE:android.graphics.Insets)nd the upper bound is the same as[WindowInsets.getInsets(int)](https://developer.android.com/reference/kotlin/android/view/WindowInsets#getInsets(kotlin.Int))for the fully shown state. This is the same as[WindowInsetsAnimationController.getHiddenStateInsets](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimationController#getHiddenStateInsets())and[WindowInsetsAnimationController.getShownStateInsets](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimationController#getShownStateInsets())in case the listener gets invoked because of an animation that originates from[WindowInsetsAnimationController](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimationController).

However, if the size of a window that causes insets is changing, these are the lower/upper bounds of that size animation.

There are no overlapping animations for a specific type, but there may be multiple animations running at the same time for different inset types.

|                                                       Return                                                        ||
|----------------------------------------------------------------------------------------|-----------------------------|
| [Insets](https://developer.android.com/reference/kotlin/android/graphics/Insets.html#) | This value cannot be`null`. |

**See Also**

- <https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimation.Bounds#getLowerBound()>
- [android.view.WindowInsetsAnimationController#getShownStateInsets](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimationController#getShownStateInsets())  

### inset

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

```
fun inset(insets: Insets): WindowInsetsAnimation.Bounds
```

Insets both the lower and upper bound by the specified insets. This is to be used in[Callback.onStart](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimation.Callback#onStart(android.view.WindowInsetsAnimation,%20android.view.WindowInsetsAnimation.Bounds))to indicate that a part of the insets has been used to offset or clip its children, and the children shouldn't worry about that part anymore.

|                                                                    Parameters                                                                     ||
|----------|-----------------------------------------------------------------------------------------------------------------------------------------|
| `insets` | [Insets](https://developer.android.com/reference/kotlin/android/graphics/Insets.html#):The amount to inset. This value cannot be`null`. |

|                                                                                                    Return                                                                                                     ||
|---------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
| [WindowInsetsAnimation.Bounds](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimation.Bounds#) | A copy of this instance inset in the given directions. This value cannot be`null`. |

**See Also**

- [android.view.WindowInsetsAnimation.Callback#onStart](https://developer.android.com/reference/kotlin/android/view/WindowInsetsAnimation.Callback#onStart(android.view.WindowInsetsAnimation,%20android.view.WindowInsetsAnimation.Bounds))  

### toString

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

```
fun toString(): String
```

|                                                          Return                                                          ||
|----------------------------------------------------------------------------------|----------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |