Transition
Animate motion in the UI with starting and ending layouts.
Latest Update Stable Release Release Candidate Beta Release Alpha Release
July 24, 2024 1.5.1 - - -

Declaring dependencies

To add a dependency on Transition, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.

Add the dependencies for the artifacts you need in the build.gradle file for your app or module:

Groovy

dependencies {
    // Java language implementation
    implementation "androidx.transition:transition:1.5.1"
    // Kotlin
    implementation "androidx.transition:transition-ktx:1.5.1"
}

Kotlin

dependencies {
    // Java language implementation
    implementation("androidx.transition:transition:1.5.1")
    // Kotlin
    implementation("androidx.transition:transition-ktx:1.5.1")
}

For more information about dependencies, see Add build dependencies.

Feedback

Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.

Create a new issue

See the Issue Tracker documentation for more information.

Version 1.5

Version 1.5.1

July 24, 2024

androidx.transition:transition:1.5.1 and androidx.transition:transition-ktx:1.5.1 are released. Version 1.5.1 contains these commits.

Bug Fixes

  • Fixed an issue where calls to animateToStart() or animateToEnd() on a seekable transition would be ignored if the transition was not started. (I44d96, b/338624457)

Version 1.5.0

May 1, 2024

androidx.transition:transition:1.5.0 and androidx.transition:transition-ktx:1.5.0 are released. Version 1.5.0 contains these commits.

Important changes since 1.4.0

  • Transitions support seeking on API 34 and above. A new API was added to TransitionManager, controlDelayedTransition(), which returns a TransitionSeekController that allows seeking the Transition. This functionality is used by Fragment 1.7.0 to automatically seek transitions when using the Predictive Back Gesture.
  • Transitions have a new method, getRootTransition(), that returns the Transition containing the current Transition or the current Transition if it isn't contained by any other Transition. This can be useful if the developer needs to have listeners for when the entire Transition starts or ends.
  • TransitionListeners now have new onTransitionStart() and onTransitionEnd() listeners that allow the developer to know whether the transition is starting or ending going in reverse or not. This can be important for developing seekable transitions that have TransitionListeners.

Version 1.5.0-rc02

April 17, 2024

androidx.transition:transition:1.5.0-rc02 and androidx.transition:transition-ktx:1.5.0-rc02 are released. Version 1.5.0-rc02 contains these commits.

Dependency Update

  • Updated Fragment dependency to version 1.7.0-rc02 which fixed a bug where if a non-seekable shared element was added to a transaction where all other transitions were seekable, there would be a crash.

Version 1.5.0-rc01

April 3, 2024

androidx.transition:transition:1.5.0-rc01 and androidx.transition:transition-ktx:1.5.0-rc01 are released. Version 1.5.0-rc01 contains these commits.

Version 1.5.0-beta01

March 20, 2024

androidx.transition:transition:1.5.0-beta01 and androidx.transition:transition-ktx:1.5.0-beta01 are released. Version 1.5.0-beta01 contains these commits.

Bug Fixes

  • Fixed an issue in Fragments where interrupting incoming transitions with a Predictive back gesture would destroy the entering view, potentially leaving a blank screen. (Id3f22, b/319531491)

Version 1.5.0-alpha06

January 10, 2024

androidx.transition:transition:1.5.0-alpha06 and androidx.transition:transition-ktx:1.5.0-alpha06 are released. Version 1.5.0-alpha06 contains these commits.

Bug Fixes

  • WhenTransitionSeekController.animateToStart() is used, added TransitionListeners will now have onTransitionEnd() called after the animateToStart()'s given Runnable. (Ic6a55, b/307624554)

Dependency Update

  • The Fragment dependency has been updated to 1.7.0-alpha08.

Version 1.5.0-alpha05

November 29, 2023

androidx.transition:transition:1.5.0-alpha05 and androidx.transition:transition-ktx:1.5.0-alpha05 are released. Version 1.5.0-alpha05 contains these commits.

Bug Fixes

  • Fixed a NullPointerException caused by setting a shared element transition and failing to set an enter/exitTransition as well. (I8472b)
  • Fixed issue where animateToStart() with Slide() failed to move the View back to the start position (I698f4, b/300157785)
  • Fixed reentrancy problem in Transition which broke cancellation. (Iddcce, b/308379201)

Version 1.5.0-alpha04

October 4, 2023

androidx.transition:transition:1.5.0-alpha04 and `androidx.transition:transition-ktx:1.5.0-alpha04 are released. Version 1.5.0-alpha04 contains these commits.

API Changes

  • Breaking Change - The animateToStart() method now takes a Runnable that should be used to return the transitioning views back to their original state.

Version 1.5.0-alpha03

September 20, 2023

androidx.transition:transition:1.5.0-alpha03 and androidx.transition:transition-ktx:1.5.0-alpha03 are released. Version 1.5.0-alpha03 contains these commits.

New Features

  • Transition now provides support for in-app Predictive Back animations on Android 14 devices when used with Fragment 1.7.0-alpha05.

Bug Fixes

  • Fixed Slide Transition interruption bug. When a Slide Transition interrupted an entering transition to remove a View, it would jump to an incorrect position. (I946f8, b/297427333)

Version 1.5.0-alpha02

September 6, 2023

androidx.transition:transition:1.5.0-alpha02 and androidx.transition:transition-ktx:1.5.0-alpha02 are released. Version 1.5.0-alpha02 contains these commits.

New Features

  • TransitionSeekController now allows you to set the progress as a fraction of the total duration via setCurrentFragment(). (aosp/2647607)
  • TransitionSeekController now allows observing progress when using animateToStart() and animateToEnd() by calling addOnProgressChangedListener. (aosp/2647607)
  • Added TransitionManager.seekTo() to allow using Scenes for seeking Transitions. (aosp/2647607)
  • Added physics-based animations to seeking transitions. It uses a 1-D velocity tracker to track the progress change with setCurrentFraction() or setCurrentPlayTimeMillis() and uses it for the initial velocity of animateToStart and animateToEnd. (aosp/2647607)

Bug Fixes

  • Fixed a flicker when seeking an AutoTransition. (aosp/2643369)
  • Fixed an issue where a Slide transition would jump to the wrong starting position when interrupted. (aosp/2733729, b/297427333)

Dependency Update

  • Transition now compiles with API 34.

Version 1.5.0-alpha01

May 10, 2023

androidx.transition:transition:1.5.0-alpha01 and androidx.transition:transition-ktx:1.5.0-alpha01 are released. This version is developed in an internal branch.

New Features

  • Transitions support seeking on API 34 and above. A new API was added to TransitionManager, controlDelayedTransition(), which returns a TransisionSeekController that allows seeking the Transition.

API Changes

  • TransitionManager has a new method, controlDelayedTransition(), that allows applications to control the progress of transition animations on API 34+. The returned TransitionSeekController lets the developer know when the transition is ready for seeking, the duration of the animation, and allows setting the current time of the animation. Only Transitions that override isSeekable() to return true are supported by controlDelayedTransition().
  • Transitions have a new method, getRootTransition(), that returns the Transition containing the current Transition or the current Transition if it isn't contained by any other Transition. This can be useful if the developer needs to have listeners for when the entire Transition starts or ends.
  • TransitionListeners now have new onTransitionStart() and onTransitionEnd() listeners that allow the developer to know whether the transition is starting or ending going in reverse or not. This can be important for developing seekable transitions that have TransitionListeners.

Bug Fixes

  • Transitions now copy their TransitionListeners when they are cloned. This means that adding new listeners during createAnimator() will not affect the root Transition.

Version 1.4.1

Version 1.4.1

April 21, 2021

androidx.transition:transition:1.4.1 and androidx.transition:transition-ktx:1.4.1 are released. Version 1.4.1 contains these commits.

Bug Fixes

  • Fixed an issue where starting a Transition in one container would inadvertently pause other running transitions in separate containers, causing those other transitions to never finish. (aosp/1664439, b/182845041)

Version 1.4.0

Version 1.4.0

January 27, 2021

androidx.transition:transition:1.4.0 and androidx.transition:transition-ktx:1.4.0 are released. Version 1.4.0 contains these commits.

Major changes since 1.3.0

  • The transition-ktx artifact introduces Kotlin extensions for adding listeners to AndroidX Transition instances. (b/138870873)

Version 1.4.0-rc01

December 2, 2020

androidx.transition:transition:1.4.0-rc01 and androidx.transition:transition-ktx:1.4.0-rc01 are released with no changes from 1.4.0-beta01. Version 1.4.0-rc01 contains these commits.

Version 1.4.0-beta01

July 22, 2020

androidx.transition:transition:1.4.0-beta01 and androidx.transition:transition-ktx:1.4.0-beta01 are released with no changes since 1.4.0-alpha01. Version 1.4.0-beta01 contains these commits.

Version 1.4.0-alpha01

June 24, 2020

androidx.transition:transition:1.4.0-alpha01 and androidx.transition:transition-ktx:1.4.0-alpha01 are released. Version 1.4.0-alpha01 contains these commits.

New Features

  • The transition-ktx artifact introduces Kotlin extensions for adding listeners to AndroidX Transition instances. (b/138870873)

Version 1.3.1

Version 1.3.1

February 19, 2020

androidx.transition:transition:1.3.1 is released. Version 1.3.1 contains these commits.

Bug Fixes

  • Fixed bug when some animated Views were incorrectly clipped when ChangeTransform is used (b/148798452)

Version 1.3.0

Version 1.3.0

January 22, 2020

androidx.transition:transition:1.3.0 is released. Version 1.3.0 contains these commits.

Important changes since 1.2.0

  • Improvements for Fragment 1.2.0: Improved the integration with Fragment 1.2.0 to ensure that the Fragment’s View is not destroyed before the transition completes and that transitions are cancelled at the appropriate time

Version 1.3.0-rc02

December 4, 2019

androidx.transition:transition:1.3.0-rc02 is released. Version 1.3.0-rc02 contains these commits.

Bug fixes

  • Fixed an issue where Views were incorrectly marked INVISIBLE after popping a hidden Fragment. (b/70793925)

Version 1.3.0-rc01

October 23, 2019

androidx.transition:transition:1.3.0-rc01 is released with no changes since 1.3.0-beta01. Version 1.3.0-rc01 contains these commits.

Version 1.3.0-beta01

October 9, 2019

androidx.transition:transition:1.3.0-beta01 is released. Version 1.3.0-beta01 contains these commits.

New features

  • Improved the integration with Fragment 1.2.0-beta01 to ensure that the Fragment’s View is not destroyed before the transition completes and that transitions are cancelled at the appropriate time. (aosp/1119841)

Version 1.2.0

Version 1.2.0

October 9, 2019

androidx.transition:transition:1.2.0 is released with no changes from 1.2.0-rc01 . Version 1.2.0 contains these commits.

Important changes since version 1.1.0

This version should be used if you're targeting API level 29. Otherwise, some of the transitions will not work properly. Instead of the reflection calls, this version uses the new public methods added in API Level 29. It is a part of our restrictions on non-SDK interfaces effort.

Version 1.2.0-rc01

September 5, 2019

androidx.transition:transition:1.2.0-rc01 is released with no changes since version 1.2.0-beta01. The commits included in this version can be found here.

Version 1.2.0-beta01

July 2, 2019

androidx.transition:transition:1.2.0-beta01 is released. The commits included in this version can be found here.

New features

  • This version should be used if you are specifying 29 as a targetSdkVersion. Otherwise, some of the transitions will not work properly. Instead of the reflection calls, this version uses the new public methods added in API Level 29. It is a part of our restrictions on non-SDK interfaces effort.

Version 1.2.0-alpha01

May 7, 2019

androidx.transition:transition:1.2.0-alpha01 is released.

New features

  • This version should be used if you are specifying Q as a targetSdkVersion. Otherwise, some of the transitions will not work properly. Instead of the reflection calls, this version uses the new public methods added in Q. It is a part of our restrictions on non-SDK interfaces effort.

Version 1.1.0

Version 1.1.0

July 2, 2019

androidx.transition:transition:1.1.0 is released with no changes from 1.1.0-rc02. The commits included in this version can be found here.

Version 1.1.0-rc02

June 5, 2019

androidx.transition:transition:1.1.0-rc02 is released. The commits included in this version can be found here.

Bug fixes

  • Fix for TransitionManager.endTransitions() to correctly work with dependent transitions. (aosp/946400)

Version 1.1.0-rc01

May 7, 2019

androidx.transition:transition:1.1.0-rc01 is released. The commits included in this version can be found here.

Version 1.1.0-beta01

April 3, 2019

androidx.transition:transition:1.1.0-beta01 is released. The commits included in this version can be found here.

Bug fixes

  • Fixed ViewGroupOverlay caching bug in Visibility, occurring on API Level 17 and lower (aosp/937350)

Version 1.1.0-alpha02

March 13, 2019

androidx.transition:transition:1.1.0-alpha02 is released. The full list of commits included in this version can be found here.

API changes

  • The method parameter’s type of Scene.getCurrentScene() was changed from View to ViewGroup.

Bug fixes

  • SidePropagation doesn’t work when an additional delay provided via setStartDelay() (b/119839526).
  • ChangeImageTransform applies wrong matrix when interrupted before API 21 (b/123226255).
  • ChangeTransform works incorrectly in some cases before API 21 (b/125777978).

Version 1.1.0-alpha01

December 3, 2018

API changes

  • aosp/807055: Scene.getCurrentScene(View) method made public. It allows you to write a custom conditional logic depending on a current scene.

Bug fixes

  • Fixed crash when using TransitionManager to collapse/expand item in RecyclerView (b/37129527).
  • Fixed incorrect animation when two Visibility transitions applied (b/62629600).
  • Allow override values like duration and interpolator for TransitionSet’s children (b/64644617).
  • Many other minor bugs fixed.