WindowInsetsAnimationControllerCompat

public final class WindowInsetsAnimationControllerCompat


Controller for app-driven animation of system windows.

WindowInsetsAnimationController lets apps animate system windows such as the IME. The animation is synchronized, such that changes the system windows and the app's current frame are rendered at the same time.

Control is obtained through controlWindowInsetsAnimation.

Summary

Public methods

void
finish(boolean shown)

Finishes the animation, and leaves the windows shown or hidden.

float

Current alpha value of the window.

@FloatRange(from = 0.0, to = 1.0) float

Returns the progress as previously set by fraction in setInsetsAndAlpha

@NonNull Insets

Retrieves the current insets.

@NonNull Insets

Retrieves the Insets when the windows this animation is controlling are fully hidden.

@NonNull Insets

Retrieves the Insets when the windows this animation is controlling are fully shown.

@WindowInsetsCompat.Type.InsetsType int
boolean

Returns whether this instance has been cancelled by the system, or by invoking the android.os.CancellationSignal passed into controlWindowInsetsAnimation.

boolean

Returns whether this instance has been finished by a call to finish.

boolean

Returns whether this instance is ready to be used to control window insets.

void
setInsetsAndAlpha(
    @Nullable Insets insets,
    @FloatRange(from = 0.0, to = 1.0) float alpha,
    @FloatRange(from = 0.0, to = 1.0) float fraction
)

Modifies the insets for the frame being drawn by indirectly moving the windows around in the system that are causing window insets.

Public constructors

WindowInsetsAnimationControllerCompat

public final WindowInsetsAnimationControllerCompat()

Public methods

finish

public void finish(boolean shown)

Finishes the animation, and leaves the windows shown or hidden.

After invoking