Google is committed to advancing racial equity for Black communities. See how.

WindowInsetsAnimationControlListenerCompat

public interface WindowInsetsAnimationControlListenerCompat

androidx.core.view.WindowInsetsAnimationControlListenerCompat


Listener that encapsulates a request to WindowInsetsControllerCompat.controlWindowInsetsAnimation(int, long, Interpolator, CancellationSignal, WindowInsetsAnimationControlListenerCompat).

Insets can be controlled with the supplied WindowInsetsAnimationControllerCompat from onReady(WindowInsetsAnimationControllerCompat, int) until either onFinished(WindowInsetsAnimationControllerCompat) or onCancelled(WindowInsetsAnimationControllerCompat).

Once the control over insets is finished or cancelled, it will not be regained until a new request to WindowInsetsControllerCompat.controlWindowInsetsAnimation(int, long, Interpolator, CancellationSignal, WindowInsetsAnimationControlListenerCompat) is made.

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

Summary

Public methods

abstract void onCancelled(WindowInsetsAnimationControllerCompat controller)

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

abstract void onFinished(WindowInsetsAnimationControllerCompat controller)

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

abstract void onReady(WindowInsetsAnimationControllerCompat controller, int types)

Called when the animation is ready to be controlled.

Public methods

onCancelled

public abstract void onCancelled (WindowInsetsAnimationControllerCompat controller)

Called when the request for control over the insets has been cancelled, either because the 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 WindowInsetsControllerCompat.controlWindowInsetsAnimation(int, long, Interpolator, CancellationSignal, WindowInsetsAnimationControlListenerCompat) is made.

Parameters
controller WindowInsetsAnimationControllerCompat: the controller which has been cancelled, or null if the request was cancelled before onReady(WindowInsetsAnimationControllerCompat, int) was invoked.

onFinished

public abstract void onFinished (WindowInsetsAnimationControllerCompat controller)

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 WindowInsetsControllerCompat.controlWindowInsetsAnimation(int, long, Interpolator, CancellationSignal, WindowInsetsAnimationControlListenerCompat) is made.

Parameters
controller WindowInsetsAnimationControllerCompat: the controller which has finished.

onReady

public abstract void onReady (WindowInsetsAnimationControllerCompat controller, 
                int types)

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 WindowInsetsCompat.Types it was able to gain control over. Note that this may be different than the types passed into WindowInsetsControllerCompat.controlWindowInsetsAnimation(int, long, Interpolator, CancellationSignal, WindowInsetsAnimationControlListenerCompat) 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.