Android 12 Developer Preview is here! Try it out, and give us your feedback!

BoundsCompat

class BoundsCompat
kotlin.Any
   ↳ androidx.core.view.WindowInsetsAnimationCompat.BoundsCompat

Class representing the range of an WindowInsetsAnimationCompat

Summary

Public constructors
<init>(@NonNull lowerBound: Insets, @NonNull upperBound: Insets)

Public methods
Insets

Queries the lower inset bound of the animation.

Insets

Queries the upper inset bound of the animation.

WindowInsetsAnimationCompat.BoundsCompat
inset(@NonNull insets: Insets)

Insets both the lower and upper bound by the specified insets.

Bounds

Creates a new instance of WindowInsetsAnimation.Bounds from this compat instance.

static WindowInsetsAnimationCompat.BoundsCompat
toBoundsCompat(@NonNull bounds: Bounds)

Create a new insance of BoundsCompat using the provided platform android.view.WindowInsetsAnimation.Bounds.

String

Public constructors

<init>

BoundsCompat(
    @NonNull lowerBound: Insets,
    @NonNull upperBound: Insets)

Public methods

getLowerBound

@NonNull 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 and the upper bound is the same as WindowInsetsCompat#getInsets(int) for the fully shown state. This is the same as WindowInsetsAnimationControllerCompat#getHiddenStateInsets and WindowInsetsAnimationControllerCompat#getShownStateInsets in case the listener gets invoked because of an animation that originates from WindowInsetsAnimationControllerCompat.

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.

getUpperBound

@NonNull 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 nd the upper bound is the same as WindowInsetsCompat#getInsets(int) for the fully shown state. This is the same as WindowInsetsAnimationControllerCompat#getHiddenStateInsets and WindowInsetsAnimationControllerCompat#getShownStateInsets in case the listener gets invoked because of an animation that originates from WindowInsetsAnimationControllerCompat.

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.

inset

@NonNull fun inset(@NonNull insets: Insets): WindowInsetsAnimationCompat.BoundsCompat

Insets both the lower and upper bound by the specified insets. This is to be used in WindowInsetsAnimationCompat.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.
Return
WindowInsetsAnimationCompat.BoundsCompat A copy of this instance inset in the given directions.

toBounds

@RequiresApi(30) @NonNull fun toBounds(): Bounds

Creates a new instance of WindowInsetsAnimation.Bounds from this compat instance.

toBoundsCompat

@RequiresApi(30) @NonNull static fun toBoundsCompat(@NonNull bounds: Bounds): WindowInsetsAnimationCompat.BoundsCompat

Create a new insance of BoundsCompat using the provided platform android.view.WindowInsetsAnimation.Bounds.

toString

fun toString(): String