Stay organized with collections
Save and categorize content based on your preferences.
WindowInsetsController.OnControllableInsetsChangedListener
public
static
interface
WindowInsetsController.OnControllableInsetsChangedListener
android.view.WindowInsetsController.OnControllableInsetsChangedListener
|
Listener to be notified when the set of controllable WindowInsets.Type
controlled by
a WindowInsetsController
changes.
Once a WindowInsets.Type
becomes controllable, the app will be able to control the
window that is causing this type of insets by calling WindowInsetsController.controlWindowInsetsAnimation(int, long, Interpolator, CancellationSignal, WindowInsetsAnimationControlListener)
.
Note: When listening to controllability of the Type.ime
,
WindowInsetsController.controlWindowInsetsAnimation(int, long, Interpolator, CancellationSignal, WindowInsetsAnimationControlListener)
may still fail in case the InputMethodService
decides to cancel the show request. This could happen when there is a hardware keyboard
attached.
Summary
Public methods
onControllableInsetsChanged
public abstract void onControllableInsetsChanged (WindowInsetsController controller,
int typeMask)
Called when the set of controllable WindowInsets.Type
changes.
Parameters |
controller |
WindowInsetsController : The controller for which the set of controllable
WindowInsets.Type s are changing.
This value cannot be null . |
typeMask |
int : Bitwise type-mask of the WindowInsets.Type s the controller is
currently able to control.
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.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 |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[],[],null,["# WindowInsetsController.OnControllableInsetsChangedListener\n\nAdded in [API level 30](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nWindowInsetsController.OnControllableInsetsChangedListener\n==========================================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/view/WindowInsetsController.OnControllableInsetsChangedListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nWindowInsetsController.OnControllableInsetsChangedListener\n`\n\n\n`\n\n\n`\n\n|-------------------------------------------------------------------------|\n| android.view.WindowInsetsController.OnControllableInsetsChangedListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nListener to be notified when the set of controllable [WindowInsets.Type](/reference/android/view/WindowInsets.Type) controlled by\na [WindowInsetsController](/reference/android/view/WindowInsetsController) changes.\n\n\nOnce a [WindowInsets.Type](/reference/android/view/WindowInsets.Type) becomes controllable, the app will be able to control the\nwindow that is causing this type of insets by calling [WindowInsetsController.controlWindowInsetsAnimation(int, long, Interpolator, CancellationSignal, WindowInsetsAnimationControlListener)](/reference/android/view/WindowInsetsController#controlWindowInsetsAnimation(int,%20long,%20android.view.animation.Interpolator,%20android.os.CancellationSignal,%20android.view.WindowInsetsAnimationControlListener)).\n\n\nNote: When listening to controllability of the [Type.ime](/reference/android/view/WindowInsets.Type#ime()),\n[WindowInsetsController.controlWindowInsetsAnimation(int, long, Interpolator, CancellationSignal, WindowInsetsAnimationControlListener)](/reference/android/view/WindowInsetsController#controlWindowInsetsAnimation(int,%20long,%20android.view.animation.Interpolator,%20android.os.CancellationSignal,%20android.view.WindowInsetsAnimationControlListener)) may still fail in case the [InputMethodService](/reference/android/inputmethodservice/InputMethodService)\ndecides to cancel the show request. This could happen when there is a hardware keyboard\nattached. \n**See also:**\n\n- [WindowInsetsController.addOnControllableInsetsChangedListener(OnControllableInsetsChangedListener)](/reference/android/view/WindowInsetsController#addOnControllableInsetsChangedListener(android.view.WindowInsetsController.OnControllableInsetsChangedListener))\n- [WindowInsetsController.removeOnControllableInsetsChangedListener(OnControllableInsetsChangedListener)](/reference/android/view/WindowInsetsController#removeOnControllableInsetsChangedListener(android.view.WindowInsetsController.OnControllableInsetsChangedListener))\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onControllableInsetsChanged](/reference/android/view/WindowInsetsController.OnControllableInsetsChangedListener#onControllableInsetsChanged(android.view.WindowInsetsController,%20int))`(`[WindowInsetsController](/reference/android/view/WindowInsetsController)` controller, int typeMask) ` Called when the set of controllable [WindowInsets.Type](/reference/android/view/WindowInsets.Type) changes. |\n\nPublic methods\n--------------\n\n### onControllableInsetsChanged\n\nAdded in [API level 30](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onControllableInsetsChanged (WindowInsetsController controller, \n int typeMask)\n```\n\nCalled when the set of controllable [WindowInsets.Type](/reference/android/view/WindowInsets.Type) changes.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `controller` | `WindowInsetsController`: The controller for which the set of controllable [WindowInsets.Type](/reference/android/view/WindowInsets.Type)s are changing. This value cannot be `null`. \u003cbr /\u003e |\n| `typeMask` | `int`: Bitwise type-mask of the [WindowInsets.Type](/reference/android/view/WindowInsets.Type)s the controller is currently able to control. 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.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 \u003cbr /\u003e |"]]