Stay organized with collections
Save and categorize content based on your preferences.
TransitionListener
interface TransitionListener
A transition listener receives notifications from a transition. Notifications indicate transition lifecycle events.
Summary
Public methods |
abstract Unit |
Notification about the cancellation of the transition.
|
abstract Unit |
Notification about the end of the transition.
|
abstract Unit |
Notification when a transition is paused.
|
abstract Unit |
Notification when a transition is resumed.
|
abstract Unit |
Notification about the start of the transition.
|
Public methods
onTransitionCancel
abstract fun onTransitionCancel(transition: Transition!): Unit
Notification about the cancellation of the transition. Note that cancel may be called by a parent TransitionSet
on a child transition which has not yet started. This allows the child transition to restore state on target objects which was set at createAnimator()
time.
Parameters |
transition |
Transition!: The transition which was canceled. |
onTransitionEnd
abstract fun onTransitionEnd(transition: Transition!): Unit
Notification about the end of the transition. Canceled transitions will always notify listeners of both the cancellation and end events. That is, onTransitionEnd(android.transition.Transition)
is always called, regardless of whether the transition was canceled or played through to completion.
Parameters |
transition |
Transition!: The transition which reached its end. |
onTransitionPause
abstract fun onTransitionPause(transition: Transition!): Unit
Notification when a transition is paused. Note that createAnimator() may be called by a parent TransitionSet
on a child transition which has not yet started. This allows the child transition to restore state on target objects which was set at createAnimator()
time.
Parameters |
transition |
Transition!: The transition which was paused. |
onTransitionResume
abstract fun onTransitionResume(transition: Transition!): Unit
Notification when a transition is resumed. Note that resume() may be called by a parent TransitionSet
on a child transition which has not yet started. This allows the child transition to restore state which may have changed in an earlier call to onTransitionPause(android.transition.Transition)
.
Parameters |
transition |
Transition!: The transition which was resumed. |
onTransitionStart
abstract fun onTransitionStart(transition: Transition!): Unit
Notification about the start of the transition.
Parameters |
transition |
Transition!: The started transition. |
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,["# Transition.TransitionListener\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nTransitionListener\n==================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/transition/Transition.TransitionListener \"View this page in Java\") \n\n```\ninterface TransitionListener\n```\n\n|-------------------------------------------------------|\n| [android.transition.Transition.TransitionListener](#) |\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [TransitionListenerAdapter](/reference/kotlin/android/transition/TransitionListenerAdapter) |---------------------------------------------------------------------------------------------|-------------------------------------------------------------------------| | [TransitionListenerAdapter](/reference/kotlin/android/transition/TransitionListenerAdapter) | This adapter class provides empty implementations of the methods from . | |\n\nA transition listener receives notifications from a transition. Notifications indicate transition lifecycle events.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onTransitionCancel](#onTransitionCancel(android.transition.Transition))`(`transition:` `[Transition](/reference/kotlin/android/transition/Transition)!`)` Notification about the cancellation of the transition. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onTransitionEnd](#onTransitionEnd(android.transition.Transition))`(`transition:` `[Transition](/reference/kotlin/android/transition/Transition)!`)` Notification about the end of the transition. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onTransitionPause](#onTransitionPause(android.transition.Transition))`(`transition:` `[Transition](/reference/kotlin/android/transition/Transition)!`)` Notification when a transition is paused. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onTransitionResume](#onTransitionResume(android.transition.Transition))`(`transition:` `[Transition](/reference/kotlin/android/transition/Transition)!`)` Notification when a transition is resumed. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onTransitionStart](#onTransitionStart(android.transition.Transition))`(`transition:` `[Transition](/reference/kotlin/android/transition/Transition)!`)` Notification about the start of the transition. |\n\nPublic methods\n--------------\n\n### onTransitionCancel\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onTransitionCancel(transition: Transition!): Unit\n```\n\nNotification about the cancellation of the transition. Note that cancel may be called by a parent [TransitionSet](/reference/kotlin/android/transition/TransitionSet) on a child transition which has not yet started. This allows the child transition to restore state on target objects which was set at [createAnimator()](/reference/kotlin/android/transition/Transition#createAnimator(android.view.ViewGroup,%20android.transition.TransitionValues,%20android.transition.TransitionValues)) time.\n\n| Parameters ||\n|--------------|----------------------------------------------------------------------------------------------------|\n| `transition` | [Transition](/reference/kotlin/android/transition/Transition)!: The transition which was canceled. |\n\n### onTransitionEnd\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onTransitionEnd(transition: Transition!): Unit\n```\n\nNotification about the end of the transition. Canceled transitions will always notify listeners of both the cancellation and end events. That is, [onTransitionEnd(android.transition.Transition)](#onTransitionEnd(android.transition.Transition)) is always called, regardless of whether the transition was canceled or played through to completion.\n\n| Parameters ||\n|--------------|-------------------------------------------------------------------------------------------------------|\n| `transition` | [Transition](/reference/kotlin/android/transition/Transition)!: The transition which reached its end. |\n\n### onTransitionPause\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onTransitionPause(transition: Transition!): Unit\n```\n\nNotification when a transition is paused. Note that createAnimator() may be called by a parent [TransitionSet](/reference/kotlin/android/transition/TransitionSet) on a child transition which has not yet started. This allows the child transition to restore state on target objects which was set at [createAnimator()](/reference/kotlin/android/transition/Transition#createAnimator(android.view.ViewGroup,%20android.transition.TransitionValues,%20android.transition.TransitionValues)) time.\n\n| Parameters ||\n|--------------|--------------------------------------------------------------------------------------------------|\n| `transition` | [Transition](/reference/kotlin/android/transition/Transition)!: The transition which was paused. |\n\n### onTransitionResume\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onTransitionResume(transition: Transition!): Unit\n```\n\nNotification when a transition is resumed. Note that resume() may be called by a parent [TransitionSet](/reference/kotlin/android/transition/TransitionSet) on a child transition which has not yet started. This allows the child transition to restore state which may have changed in an earlier call to [onTransitionPause(android.transition.Transition)](#onTransitionPause(android.transition.Transition)).\n\n| Parameters ||\n|--------------|---------------------------------------------------------------------------------------------------|\n| `transition` | [Transition](/reference/kotlin/android/transition/Transition)!: The transition which was resumed. |\n\n### onTransitionStart\n\nAdded in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onTransitionStart(transition: Transition!): Unit\n```\n\nNotification about the start of the transition.\n\n| Parameters ||\n|--------------|-----------------------------------------------------------------------------------------|\n| `transition` | [Transition](/reference/kotlin/android/transition/Transition)!: The started transition. |"]]