WindowInsetsAnimationControlListenerCompat

Added in 1.5.0

interface WindowInsetsAnimationControlListenerCompat


Listener that encapsulates a request to controlWindowInsetsAnimation.

Insets can be controlled with the supplied WindowInsetsAnimationControllerCompat 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 controlWindowInsetsAnimation is made.

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

Summary

Public functions

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).

Unit

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

Unit

Called when the animation is ready to be controlled.

Public functions

onCancelled

Added in 1.5.0
fun onCancelled(controller: WindowInsetsAnimationControllerCompat?): 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 WindowInsetsAnimationControllerCompat is no longer ready.

Control will not be regained until a new request to controlWindowInsetsAnimation is made.

Parameters
controller: WindowInsetsAnimationControllerCompat?

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

See also
isCancelled

onFinished

Added in 1.5.0
fun onFinished(controller: WindowInsetsAnimationControllerCompat): Unit

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

Once this callback is invoked, the supplied WindowInsetsAnimationControllerCompat is no longer ready.

Control will not be regained until a new request to controlWindowInsetsAnimation is made.

Parameters
controller: WindowInsetsAnimationControllerCompat

the controller which has finished.

See also
isFinished

onReady

Added in 1.5.0
fun onReady(controller: WindowInsetsAnimationControllerCompat, 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: WindowInsetsAnimationControllerCompat

The controller to control the inset animation.

types: Int

The Types it was able to gain control over. Note that this may be different than the types passed into 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.

See also
isReady