Stay organized with collections
Save and categorize content based on your preferences.
Bounds
class Bounds
Class representing the range of an WindowInsetsAnimation
Summary
Public constructors
Bounds
Bounds(
lowerBound: Insets,
upperBound: Insets)
Parameters |
lowerBound |
Insets: This value cannot be null . |
upperBound |
Insets: This value cannot be null . |
Public methods
inset
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
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: The amount to inset. This value cannot be null . |
toString
fun toString(): String
Return |
String |
a string representation of the object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# WindowInsetsAnimation.Bounds\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBounds\n======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/WindowInsetsAnimation.Bounds \"View this page in Java\") \n\n```\nclass Bounds\n```\n\n|---|------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.view.WindowInsetsAnimation.Bounds](#) |\n\nClass representing the range of an [WindowInsetsAnimation](/reference/kotlin/android/view/WindowInsetsAnimation)\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Bounds](#Bounds(android.graphics.Insets,%20android.graphics.Insets))`(`lowerBound:` `[Insets](../graphics/Insets.html#)`, `upperBound:` `[Insets](../graphics/Insets.html#)`)` \u003cbr /\u003e |\n\n| Public methods ||\n|----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Insets](../graphics/Insets.html#) | [getLowerBound](#getLowerBound())`()` Queries the lower inset bound of the animation. |\n| [Insets](../graphics/Insets.html#) | [getUpperBound](#getUpperBound())`()` Queries the upper inset bound of the animation. |\n| [WindowInsetsAnimation.Bounds](#) | [inset](#inset(android.graphics.Insets))`(`insets:` `[Insets](../graphics/Insets.html#)`)` Insets both the lower and upper bound by the specified insets. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` \u003cbr /\u003e |\n\nPublic constructors\n-------------------\n\n### Bounds\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBounds(\n lowerBound: Insets, \n upperBound: Insets)\n```\n\n| Parameters ||\n|--------------|------------------------------------------------------------------|\n| `lowerBound` | [Insets](../graphics/Insets.html#): This value cannot be `null`. |\n| `upperBound` | [Insets](../graphics/Insets.html#): This value cannot be `null`. |\n\nPublic methods\n--------------\n\n### getLowerBound\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getLowerBound(): Insets\n```\n\nQueries 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](../graphics/Insets.html#NONE:android.graphics.Insets) and the upper bound is the same as [WindowInsets.getInsets(int)](/reference/kotlin/android/view/WindowInsets#getInsets(kotlin.Int)) for the fully shown state. This is the same as [WindowInsetsAnimationController.getHiddenStateInsets](/reference/kotlin/android/view/WindowInsetsAnimationController#getHiddenStateInsets()) and [WindowInsetsAnimationController.getShownStateInsets](/reference/kotlin/android/view/WindowInsetsAnimationController#getShownStateInsets()) in case the listener gets invoked because of an animation that originates from [WindowInsetsAnimationController](/reference/kotlin/android/view/WindowInsetsAnimationController).\n\nHowever, if the size of a window that causes insets is changing, these are the lower/upper bounds of that size animation.\nThere are no overlapping animations for a specific type, but there may be multiple animations running at the same time for different inset types.\n\n| Return ||\n|------------------------------------|------------------------------|\n| [Insets](../graphics/Insets.html#) | This value cannot be `null`. |\n\n**See Also**\n\n- \u003c#getUpperBound()\u003e\n- [android.view.WindowInsetsAnimationController#getHiddenStateInsets](/reference/kotlin/android/view/WindowInsetsAnimationController#getHiddenStateInsets()) \n\n### getUpperBound\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getUpperBound(): Insets\n```\n\nQueries 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](../graphics/Insets.html#NONE:android.graphics.Insets) nd the upper bound is the same as [WindowInsets.getInsets(int)](/reference/kotlin/android/view/WindowInsets#getInsets(kotlin.Int)) for the fully shown state. This is the same as [WindowInsetsAnimationController.getHiddenStateInsets](/reference/kotlin/android/view/WindowInsetsAnimationController#getHiddenStateInsets()) and [WindowInsetsAnimationController.getShownStateInsets](/reference/kotlin/android/view/WindowInsetsAnimationController#getShownStateInsets()) in case the listener gets invoked because of an animation that originates from [WindowInsetsAnimationController](/reference/kotlin/android/view/WindowInsetsAnimationController).\n\nHowever, if the size of a window that causes insets is changing, these are the lower/upper bounds of that size animation.\n\nThere are no overlapping animations for a specific type, but there may be multiple animations running at the same time for different inset types.\n\n| Return ||\n|------------------------------------|------------------------------|\n| [Insets](../graphics/Insets.html#) | This value cannot be `null`. |\n\n**See Also**\n\n- \u003c#getLowerBound()\u003e\n- [android.view.WindowInsetsAnimationController#getShownStateInsets](/reference/kotlin/android/view/WindowInsetsAnimationController#getShownStateInsets()) \n\n### inset\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun inset(insets: Insets): WindowInsetsAnimation.Bounds\n```\n\nInsets both the lower and upper bound by the specified insets. This is to be used in [Callback.onStart](/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.\n\n| Parameters ||\n|----------|---------------------------------------------------------------------------------------|\n| `insets` | [Insets](../graphics/Insets.html#): The amount to inset. This value cannot be `null`. |\n\n| Return ||\n|-----------------------------------|-------------------------------------------------------------------------------------|\n| [WindowInsetsAnimation.Bounds](#) | A copy of this instance inset in the given directions. This value cannot be `null`. |\n\n**See Also**\n\n- [android.view.WindowInsetsAnimation.Callback#onStart](/reference/kotlin/android/view/WindowInsetsAnimation.Callback#onStart(android.view.WindowInsetsAnimation,%20android.view.WindowInsetsAnimation.Bounds)) \n\n### toString\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun toString(): String\n```\n\n| Return ||\n|----------------------------------------------------------------------------------|----------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |"]]