Stay organized with collections
Save and categorize content based on your preferences.
OnLayoutChangeListener
interface OnLayoutChangeListener
Interface definition for a callback to be invoked when the layout bounds of a view changes due to layout processing.
Summary
Public methods |
abstract Unit |
Called when the layout bounds of a view changes due to layout processing.
|
Public methods
onLayoutChange
abstract fun onLayoutChange(
v: View!,
left: Int,
top: Int,
right: Int,
bottom: Int,
oldLeft: Int,
oldTop: Int,
oldRight: Int,
oldBottom: Int
): Unit
Called when the layout bounds of a view changes due to layout processing.
Parameters |
v |
View!: The view whose bounds have changed. |
left |
Int: The new value of the view's left property. |
top |
Int: The new value of the view's top property. |
right |
Int: The new value of the view's right property. |
bottom |
Int: The new value of the view's bottom property. |
oldLeft |
Int: The previous value of the view's left property. |
oldTop |
Int: The previous value of the view's top property. |
oldRight |
Int: The previous value of the view's right property. |
oldBottom |
Int: The previous value of the view's bottom property. |
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-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# View.OnLayoutChangeListener\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnLayoutChangeListener\n======================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/View.OnLayoutChangeListener \"View this page in Java\") \n\n```\ninterface OnLayoutChangeListener\n```\n\n|-----------------------------------------------|\n| [android.view.View.OnLayoutChangeListener](#) |\n\nInterface definition for a callback to be invoked when the layout bounds of a view changes due to layout processing.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onLayoutChange](#onLayoutChange(android.view.View,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int))`(`v:` `[View](/reference/kotlin/android/view/View)!`, `left:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `top:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `right:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `bottom:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `oldLeft:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `oldTop:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `oldRight:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `oldBottom:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Called when the layout bounds of a view changes due to layout processing. |\n\nPublic methods\n--------------\n\n### onLayoutChange\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onLayoutChange(\n v: View!, \n left: Int, \n top: Int, \n right: Int, \n bottom: Int, \n oldLeft: Int, \n oldTop: Int, \n oldRight: Int, \n oldBottom: Int\n): Unit\n```\n\nCalled when the layout bounds of a view changes due to layout processing.\n\n| Parameters ||\n|-------------|-------------------------------------------------------------------------------------------------------------------------------|\n| `v` | [View](/reference/kotlin/android/view/View)!: The view whose bounds have changed. |\n| `left` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The new value of the view's left property. |\n| `top` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The new value of the view's top property. |\n| `right` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The new value of the view's right property. |\n| `bottom` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The new value of the view's bottom property. |\n| `oldLeft` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The previous value of the view's left property. |\n| `oldTop` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The previous value of the view's top property. |\n| `oldRight` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The previous value of the view's right property. |\n| `oldBottom` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The previous value of the view's bottom property. |"]]