The Developer Preview for Android 11 is now available; test it out and share your feedback.

WindowInsetsAnimationControlListener

public interface WindowInsetsAnimationControlListener

android.view.WindowInsetsAnimationControlListener


Interface that informs the client about WindowInsetsAnimationController state changes.

Summary

Public methods

abstract void onCancelled()

Called when the window no longer has control over the requested types.

abstract void onReady(WindowInsetsAnimationController controller, int types)

Called when the animation is ready to be controlled.

Public methods

onCancelled

public abstract void onCancelled ()

Called when the window no longer has control over the requested types. If it loses control over one type, the whole control will be cancelled. If none of the requested types were available when requesting the control, the animation control will be cancelled immediately without onReady(WindowInsetsAnimationController, int) being called.

onReady

public abstract void onReady (WindowInsetsAnimationController 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 WindowInsetsAnimationController: The controller to control the inset animation. This value must never be null.

types int: The InsetsTypes it was able to gain control over. Note that this may be different than the types passed into WindowInsetsController#controlInputMethodAnimation 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, and android.view.WindowInsets.Type.TAPPABLE_ELEMENT