Added in API level 30

WindowInsetsAnimationControlListener

interface WindowInsetsAnimationControlListener
android.view.WindowInsetsAnimationControlListener

Listener that encapsulates a request to WindowInsetsController#controlWindowInsetsAnimation.

Insets can be controlled with the supplied WindowInsetsAnimationController from onReady until either onFinished or onCancelled.

Once the control over insets is finished or cancelled, it will not be regained until a new request to WindowInsetsController#controlWindowInsetsAnimation is made.

The request to control insets can fail immediately. In that case onCancelled will be invoked without a preceding onReady.

Summary

Public methods
abstract Unit

Called when the request for control over the insets has been cancelled, either because the android.os.CancellationSignal associated with the request has been invoked, or the window has lost control over the insets (e.g. because it lost focus).

abstract Unit

Called when the request for control over the insets has finished.

abstract Unit

Called when the animation is ready to be controlled.

Public methods

onCancelled

Added in API level 30
abstract fun onCancelled(controller: WindowInsetsAnimationController?): Unit

Called when the request for control over the insets has been cancelled, either because the android.os.CancellationSignal associated with the request has been invoked, or the window has lost control over the insets (e.g. because it lost focus). Once this callback is invoked, the supplied WindowInsetsAnimationController is no longer ready. Control will not be regained until a new request to WindowInsetsController#controlWindowInsetsAnimation is made.

Parameters
controller WindowInsetsAnimationController?: the controller which has been cancelled, or null if the request was cancelled before onReady was invoked.

onFinished

Added in API level 30
abstract fun onFinished(controller: WindowInsetsAnimationController): Unit

Called when the request for control over the insets has finished. Once this callback is invoked, the supplied WindowInsetsAnimationController is no longer ready. Control will not be regained until a new request to WindowInsetsController#controlWindowInsetsAnimation is made.

Parameters
controller WindowInsetsAnimationController: the controller which has finished. This value cannot be null.

onReady

Added in API level 30
abstract fun onReady(
    controller: WindowInsetsAnimationController,
    types: Int
): Unit

Called when the animation is ready to be controlled. This may be delayed when the IME needs to redraw because of an EditorInfo change, or when the window is starting up.

Parameters
controller WindowInsetsAnimationController: The controller to control the inset animation. This value cannot be null.
types Int: The WindowInsets.Types it was able to gain control over. Note that this may be different than the types passed into WindowInsetsController#controlWindowInsetsAnimation in case the window wasn't able to gain the controls because it wasn't the IME target or not currently the window that's controlling the system bars. Value is either 0 or a combination of android.view.WindowInsets.Type.STATUS_BARS, android.view.WindowInsets.Type.NAVIGATION_BARS, android.view.WindowInsets.Type.CAPTION_BAR, android.view.WindowInsets.Type.IME, android.view.WindowInsets.Type.WINDOW_DECOR, android.view.WindowInsets.Type.SYSTEM_GESTURES, android.view.WindowInsets.Type.MANDATORY_SYSTEM_GESTURES, android.view.WindowInsets.Type.TAPPABLE_ELEMENT, android.view.WindowInsets.Type.DISPLAY_CUTOUT, and android.view.WindowInsets.Type.SYSTEM_OVERLAYS