Stay organized with collections
Save and categorize content based on your preferences.
OnControllableInsetsChangedListener
interface 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 controlWindowInsetsAnimation
.
Note: When listening to controllability of the Type.ime
, controlWindowInsetsAnimation
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
abstract fun onControllableInsetsChanged(
controller: WindowInsetsController,
typeMask: Int
): Unit
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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnControllableInsetsChangedListener\n===================================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/WindowInsetsController.OnControllableInsetsChangedListener \"View this page in Java\") \n\n```\ninterface OnControllableInsetsChangedListener\n```\n\n|------------------------------------------------------------------------------|\n| [android.view.WindowInsetsController.OnControllableInsetsChangedListener](#) |\n\nListener to be notified when the set of controllable [WindowInsets.Type](/reference/kotlin/android/view/WindowInsets.Type) controlled by a [WindowInsetsController](/reference/kotlin/android/view/WindowInsetsController) changes.\n\nOnce a [WindowInsets.Type](/reference/kotlin/android/view/WindowInsets.Type) becomes controllable, the app will be able to control the window that is causing this type of insets by calling [controlWindowInsetsAnimation](/reference/kotlin/android/view/WindowInsetsController#controlWindowInsetsAnimation(kotlin.Int,%20kotlin.Long,%20android.view.animation.Interpolator,%20android.os.CancellationSignal,%20android.view.WindowInsetsAnimationControlListener)).\n\nNote: When listening to controllability of the [Type.ime](/reference/kotlin/android/view/WindowInsets.Type#ime()), [controlWindowInsetsAnimation](/reference/kotlin/android/view/WindowInsetsController#controlWindowInsetsAnimation(kotlin.Int,%20kotlin.Long,%20android.view.animation.Interpolator,%20android.os.CancellationSignal,%20android.view.WindowInsetsAnimationControlListener)) may still fail in case the [InputMethodService](../inputmethodservice/InputMethodService.html#) decides to cancel the show request. This could happen when there is a hardware keyboard attached.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onControllableInsetsChanged](#onControllableInsetsChanged(android.view.WindowInsetsController,%20kotlin.Int))`(`controller:` `[WindowInsetsController](/reference/kotlin/android/view/WindowInsetsController)`, `typeMask:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Called when the set of controllable [WindowInsets.Type](/reference/kotlin/android/view/WindowInsets.Type) changes. |\n\nPublic methods\n--------------\n\n### onControllableInsetsChanged\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onControllableInsetsChanged(\n controller: WindowInsetsController, \n typeMask: Int\n): Unit\n```\n\nCalled when the set of controllable [WindowInsets.Type](/reference/kotlin/android/view/WindowInsets.Type) changes.\n\n| Parameters ||\n|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `controller` | [WindowInsetsController](/reference/kotlin/android/view/WindowInsetsController): The controller for which the set of controllable [WindowInsets.Type](/reference/kotlin/android/view/WindowInsets.Type)s are changing. This value cannot be `null`. |\n| `typeMask` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Bitwise type-mask of the [WindowInsets.Type](/reference/kotlin/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 |"]]