Google is committed to advancing racial equity for Black communities. See how.

Compose Animation

Build animations in their Jetpack Compose applications to enrich the user experience.
Latest Update Current Stable Release Next Release Candidate Beta Release Alpha Release
January 13, 2021 - - - 1.0.0-alpha10


Compose is combination of 6 Maven Group Ids within androidx. Each Group contains a targeted subset of functionality, each with it's own set of release notes.

This table explains the groups and links to each set of release notes.

compose.animationBuild animations in their Jetpack Compose applications to enrich the user experience.
compose.compilerTransform @Composable functions and enable optimizations with a Kotlin compiler plugin.
compose.foundationWrite Jetpack Compose applications with ready to use building blocks and extend foundation to build your own design system pieces.
compose.materialBuild Jetpack Compose UIs with ready to use Material Design Components. This is the higher level entry point of Compose, designed to provide components that match those described at
compose.runtimeFundamental building blocks of Compose's programming model and state management, and core runtime for the Compose Compiler Plugin to target.
compose.uiFundamental components of compose UI needed to interact with the device, including layout, drawing, and input.

Declaring dependencies

To add a dependency on Compose, 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:

dependencies {
    implementation "androidx.compose.animation:animation:1.0.0-alpha10"

android {
    buildFeatures {
        compose true

    composeOptions {
        kotlinCompilerVersion "1.4.21"
        kotlinCompilerExtensionVersion "1.0.0-alpha10"

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
    kotlinOptions {
        jvmTarget = "1.8"
        freeCompilerArgs += ["-Xallow-jvm-ir-dependencies"]

For more information about dependencies, see Add build dependencies.


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.0.0

Version 1.0.0-alpha10

January 13, 2021

androidx.compose.animation:animation:1.0.0-alpha10 and androidx.compose.animation:animation-core:1.0.0-alpha10 are released. Version 1.0.0-alpha10 contains these commits.

API Changes

  • Modified Velocity to have component parts and mathematical operations. (Ib0447)
  • Renamed @ExperimentalTesting to @ExperimentalTestApi to be consistent with similar experimental api annotations (Ia4502, b/171464963)
  • Renamed Position to DpOffset and removed getDistance() (Ib2dfd)
  • Removed Any.identityHashCode() public api (I025d7)

Bug Fixes

  • New coroutine-based API Animatable that ensures mutual exclusiveness among its animations. New DecayAnimationSpec to support multi-dimensional decay animation (I820f2, b/168014930)
  • animate() is now replaced with animateAsState(), which returns a State<T> instead of T. This allows better performance, as the invalidation scope can be narrowed down to where the State value is read. (Ib179e)

Version 1.0.0-alpha09

December 16, 2020

androidx.compose.animation:animation:1.0.0-alpha09 and androidx.compose.animation:animation-core:1.0.0-alpha09 are released. Version 1.0.0-alpha09 contains these commits.

API Changes

  • Moved Dp.VectorConverter, Position.VectorConverter, etc to animation-core, and deprecated the old VectorConveters (If0c4b)
  • Introduced a whole new set of Transition APIs with improved ease of use, and support for dynamically added animations, and dynamically calculated animation targets. This APIs are marked experimental for easy differentiation from the TransitionDefinition-based API. (Ia7fe3)

Bug Fixes

  • Lambdas in offset modifiers now return IntOffset rather than Float. (Ic9ee5, b/174137212, b/174146755)
  • Deprecate LazyColumnFor, LazyRowFor, LazyColumnForIndexed and LazyRowForIndexed. Use LazyColumn and LazyRow instead (I5b48c)
  • For suspending pointer input APIs, renamed HandlePointerInputScope to AwaitPointerEventScope and handlePointerInput() to awaitPointerEventScope(). (Idf0a1, b/175142755)
  • New infiniteRepeatable function for creating an InfiniteRepeatableSpec (I668e5)
  • Removed ExperimentalPointerInput annotation (Ia7a24)

Version 1.0.0-alpha08

December 2, 2020

androidx.compose.animation:animation:1.0.0-alpha08 and androidx.compose.animation:animation-core:1.0.0-alpha08 are released. Version 1.0.0-alpha08 contains these commits.

API Changes

  • Added lint check for composable lambda parameter naming and position, to check for consistency with Compose guidelines. Also migrated some APIs using children as the name for their trailing lambda to content, according to the lint check and guidance. (Iec48e)
  • Previously Deprecated APIs were removed:
    • Modifier.onPositioned was removed, use Modifier.onGloballyPositioned.
    • Modifier.onDraw was removed, use Modifier.onDrawBehind.
    • was removed, use Modifier.then.
    • Color.Unset was removed, use Color.Unspecified.
    • PxBounds class was removed, use Rect instead.
    • (Ie9d02, b/172562222)
  • Temporarily added option to let the TestAnimationClock be driven by the MonotonicFrameClock (I1403b, b/173402197)

Bug Fixes

  • Renamed Modifier.drawLayer to Modifier.graphicsLayer Also updated related classes to GraphicsLayer as per API council feedback. (I0bd29, b/173834241)
  • Added Modifier.scale/rotate APIs as conveniences for drawLayer.
    • Renamed Modifier.drawOpacity to Modifier.alpha
    • Renamed Modifier.drawShadow to Modifier.shadow (I264ca, b/173208140)
  • Made PointerInputData's uptime and position fields non-nullable. (Id468a)
  • offsetPx modifiers were renamed to offset. They are now taking lambda parameters instead of State. (Ic3021, b/173594846)
  • New APIs for running animations in coroutines (Ied662)
  • Deprecated Ambients named with Ambient as their suffix, and replaced them with new properties prefixed with Ambient, following other Ambients and Compose API guidelines. (I33440)
  • Time control in tests (TestAnimationClock and its usages) is now experimental (I6ef86, b/171378521)
  • Remove old ui-test module and its stubs (I3a7cb)
  • RestorableStateHolder.withRestorableState function was renamed to RestorableStateProvider (I66640)
  • The Alignment interface was updated and made functional. (I46a07, b/172311734)

Version 1.0.0-alpha07

November 11, 2020

androidx.compose.animation:animation:1.0.0-alpha07 and androidx.compose.animation:animation-core:1.0.0-alpha07 are released. Version 1.0.0-alpha07 contains these commits.

Bug Fixes

  • The foundation AmbientTextStyle, ProvideTextStyle, and AmbientContentColor have been deprecated. Instead use the new versions available in the Material library. For non-Material applications, you should instead create your own design system specific theming ambients that can be consumed in your own components. (I74acc, b/172067770)
  • foundation.Text has been deprecated and replaced with material.Text. For a basic, unopinionated text API that does not consume values from a theme, see (If64cb)
  • MeasureResult was moved out of MeasureScope. (Ibf96d, b/171184002)
  • Several layout related symbols were moved from androidx.compose.ui to androidx.compose.layout.ui. (I0fa98, b/170475424)

Version 1.0.0-alpha06

October 28, 2020

androidx.compose.animation:animation:1.0.0-alpha06 and androidx.compose.animation:animation-core:1.0.0-alpha06 are released. Version 1.0.0-alpha06 contains these commits.

API Changes

  • Enable transitions in ComposeTestRule; remove option to enable the blinking cursor from ComposeTestRule. (If0de3)

Version 1.0.0-alpha05

October 14, 2020

androidx.compose.animation:animation:1.0.0-alpha05 and androidx.compose.animation:animation-core:1.0.0-alpha05 are released. Version 1.0.0-alpha05 contains these commits.

API Changes

  • New Animation interface and subclasses: These classes store the start and end conditions for animations, and therefore allow value and velocity to be queried via only playtime (Ie95bd, b/163329867)

Bug Fixes

  • OnPositionedModifier is renamed to OnGloballyPositionedModifier and onPositioned() is renamed to onGloballyPositioned(). (I587e8, b/169083903)
  • Deprecates contentColor() and currentTextStyle() APIs, and replaces them with AmbientContentColor and AmbientTextStyle ambients respectively. You can access the current value by using .current on the ambient property, as with any other ambient. This was change was made for consistency and to avoid having multiple ways to accomplish the same thing. Additionally renames some ambient properties to better describe their purpose as follows:

    • ContentColorAmbient -> AmbientContentColor
    • TextStyleAmbient -> AmbientTextStyle
    • IndicationAmbient -> AmbientIndication
    • EmphasisAmbient -> AmbientEmphasisLevels
    • RippleThemeAmbient -> AmbientRippleTheme (I37b6d)

Version 1.0.0-alpha04

October 1, 2020

androidx.compose.animation:animation:1.0.0-alpha04 and androidx.compose.animation:animation-core:1.0.0-alpha04 are released. Version 1.0.0-alpha04 contains these commits.

API Changes

  • Annotated rootAnimationClockFactory, transitionsEnabled, blinkingCursorEnabled and textInputServiceFactory with @VisibleForTesting, make them internal API and hide their kdoc (I554eb, b/168308412)

Bug Fixes

  • Updated many Graphics APIs
    • Updated scale and rotation transformation APIs to consume a single Offset parameter to represent the pivot coordinate instead of separate float parameters for the x/y coordinates in DrawScope and DrawTransform
    • Removed Rect.expandToInclude and Rect.join methods
    • Updated Radius documentation to say oval in addition to elliptical
    • Added documentation to indicate the public constructor for the inline Radius class is not to be called directly but instead Radius objects should be instantiated through their function constructors
    • Removed RoundRect APIs to query topRight, bottomRight, bottomCenter, etc.
    • Deprecated Rect.shift in favor of Rect.translate
    • Removed RoundRect.grow and Rect.shrink APIs
    • Renamed RoundRect.outerRect to Rect.boundingRect
    • Removed RoundRect.middleRect/tallMiddleRect/wideMiddleRect and Rect.isStadium methods
    • Renamed RoundRect.longestSide to RoundRect.maxDimension
    • Renamed RoundRect.shortestSide to RoundRect.minDimension
    • Changed to be a property instead of a function
    • Updated RoundRect constructor to consume Radius properties instead of individual parameters for x/y radius values
    • Removed Size APIs that assumed it was a Rectangle with origin at 0,0
    • Added a destructing API to Radius
    • Migrated various RoundRect extension functions to be properties instead
    • (I8f5c7, b/168762961)
  • foundation.Box was deprecated. Please use foundation.layout.Box instead. (Ie5950, b/167680279)
  • Stack was renamed to Box. The previously existing Box will be deprecated in favor of the new Box in The behavior of the new Box is to stack children one on top of another when it has multiple children - this is different from the previous Box, which was behaving similar to a Column. (I94893, b/167680279)
  • Box decoration parameters have been deprecated. If you want to have decorations/padding on your box, use Modifiers instead (Modifier.background, Modifier.border, Modifier.padding) (Ibae92, b/167680279)
  • We prevented static imports of contents of layout scopes (e.g. alignWithSiblings in RowScope). The explicit scope alternative should be used instead: with(RowScope) { Modifier.alignWithSiblings(FirstBaseline) }. (I216be, b/166760797)

Version 1.0.0-alpha03

September 16, 2020

androidx.compose.animation:animation:1.0.0-alpha03 and androidx.compose.animation:animation-core:1.0.0-alpha03 are released. Version 1.0.0-alpha03 contains these commits.

Bug Fixes

  • Usages of gravity were consistently renamed to align or alignment in layout APIs. (I2421a, b/164077038)

Version 1.0.0-alpha02

September 2, 2020

androidx.compose.animation:animation:1.0.0-alpha02 and androidx.compose.animation:animation-core:1.0.0-alpha02 are released. Version 1.0.0-alpha02 contains these commits.

API Changes

  • Added ManualFrameClock.hasAwaiters to see if anything is awaiting a frame from that clock; runWithManualClock as a replacement for runBlocking when running tests that need a ManualFrameClock; TestUiDispatcher.Main that gives easy access to the main UI dispatcher in your tests.

    For example:

    fun myTest() = runWithManualClock { clock ->
        // set some compose content
        withContext(TestUiDispatcher.Main) {
        if (clock.hasAwaiters) {
            println("The clock has awaiters")
        } else {
            println("The clock has no more awaiters")

    (I0a85b, b/161247083)

Bug Fixes

  • onPreCommit is deprecated; onCommit now has onPreCommit's behavior.

    onCommit and onActive now run in the same choreographer frame that the composition changes committed in rather than at the beginning of the next choreographer frame. (I70403)

Version 1.0.0-alpha01

August 26, 2020

androidx.compose.animation:animation:1.0.0-alpha01 and androidx.compose.animation:animation-core:1.0.0-alpha01 are released. Version 1.0.0-alpha01 contains these commits.

Version 0.1.0-dev

Version 0.1.0-dev17

August 19, 2020

androidx.compose.animation:animation:0.1.0-dev17 and androidx.compose.animation:animation-core:0.1.0-dev17 are released. Version 0.1.0-dev17 contains these commits.

New Features

API Changes

  • Offset has become an inline class (Iaec70)
  • IntOffset is now an inline class (Iac0bf)
  • IntSize is now an inline class (I2bf42)
  • AnimatedVisibilty composable animates the appearance and disappearance of the child content.

    EnterTransition and ExitTransition are introduced to work with AnimatedVisibilty composable to provide 3 different typs of appearance and disappearance animation: fade, slide, and expand/shrink the content. The different types of animations can be combined to achieve more bespoke look and feel. (Idda11)

  • Deprecated PxBounds in favor of Rect. Updated all usages of PxBounds with rect and added proper deprecate/replace with annotations to assist with the migration. (I37038, b/162627058)

Bug Fixes

  • PlacementScope.placeAbsolute() was renamed to, and the previous was renamed to PlacementScope.placeRelative(). As a result, the method will not automatically mirror the position in right-to-left contexts anymore. If this is desired, use PlacementScope.placeRelative() instead. (I873ac, b/162916675)
  • The state { ... } composable is now deprecated in favor of explicit calls to remember { mutableStateOf(...) } for clarity. This reduces the overall API surface and number of concepts for state management, and matches the by mutableStateOf() pattern for class property delegation. (Ia5727)

Version 0.1.0-dev16

August 5, 2020

androidx.compose.animation:animation:0.1.0-dev16 and androidx.compose.animation:animation-core:0.1.0-dev16 are released. Version 0.1.0-dev16 contains these commits.

API Changes

  • Built-in vector converters to convert built-in units are now accessible via Foo.VectorConverter. e.g. Dp.VectorConverter, Color.VectorConverter, Float.VectorConverter, etc (I3e273)
  • Support end listener in Modifier.animateContentSize() such that when size change animation finishes, the listener will be notified, along with start/end size of the animation. (I277b2)
  • New animateContentSize modifier that animates the layout size change of its child modifier (Ieffdc)
  • Added MonotonicFrameAnimationClock that enables you to use a MonotonicFrameClock as an AnimationClockObservable to bridge the gap between the new coroutines based clocks and APIs that still use the old callback based clocks.

    The MonotonicFrameClockequivalent of ManualAnimationClock is now ManualFrameClock. (I111c7, b/161247083)

Bug Fixes

  • The APIs for right-to-left support has been updated. LayoutDirectionAmbient has been added, which can be used to read and change the layout direction. Modifier.rtl and Modifier.ltr have been removed. (I080b3)
  • Require type T to be explicitly specified for transitionDefinition. (I1aded)
  • foundation.shape.corner package were flatten to foundation.share (I46491, b/161887429)
  • has been deprecated, use Modifier.then instead. 'Then' has a stronger signal of ordering, while also prohibits to type Modifier.padding().background() + anotherModifier, which breaks the chain and harder to read (Iedd58, b/161529964)
  • Modifier.drawBackground has been renamed to Modifier.background (I13677)

Version 0.1.0-dev15

July 22, 2020

androidx.compose.animation:animation:0.1.0-dev15 and androidx.compose.animation:animation-core:0.1.0-dev15 are released. Version 0.1.0-dev15 contains these commits.

Dependencies Update

  • To use the 0.1.0-dev15 version of Compose, you will need to update your dependencies according to the new code snippets shown above in Declaring dependencies.

API Changes

  • Transition API has been changed to return a TransitionState instead of passing the TransitionState to children. This makes the API more consistent with animate() APIs. (I24e38)
  • Modifier parameter added for Crossfade (I87cfe, b/159706180)
  • Use AnimationSpec instead of AnimationBuilder in the top level APIs to clarify the concept of static animation specification
    • Improve the transition DSL by removing the lambda requirement for creating AnimationSpecs such as tween, spring. They instead take constructor params directly.
    • Improve the overall ease of use of AnimationSpec opening up constructors instead of relying on builders
    • Change the duration and delay for KeyFrames and Tween to Int. This eliminates unnecessary type casts and method overloading (for supporting both Long and Int). (Ica0b4)
  • Replaced usage of IntPx with Int. Replaced IntPxPosition with IntOffset. Replaced IntPxSize with IntSize. (Ib7b44)
  • In order to consolidate the number of classes used to represent sizing information, standardize on usage of the Size class instead of PxSize. This provides the benefits of an inline class to leverage a long to pack 2 float values to represent width and height represented as floats. (Ic0191)
  • In order to consolidate the number of classes used to represent positioning information, standardize on usage of the Offset class instead of PxPosition. This provides the benefits of an inline class to leverage a long to pack 2 float values to represent x and y offsets represented as floats. (I3ad98)
  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters (I086f4)
  • Added animate() support for Dp, Px, Size, Position, Bounds, PxPosition, PxSize, PxBounds, IntPx, IntPxSize, IntPxPosition, IntPxBounds, and AnimationVector (Ib7518)
  • Crossfade now accepts optional AnimationBuilder param to allow configuring the animation (I6d6e0)
  • Replaced all nullable Color uses in API with non-nullable and use Color.Unset instead of null (Iabaa7)
  • Removed ValueHolder class. Restructured AnimatedValue, AnimatedFloat classes to make the animation value field abstract so that subclasses can watch the value update.
    • Added model classes for AnimatedValue, AnimatedFloat, etc.
    • Added a new set of light-weight @Composable API for animating between values. (I79530)
  • Breaking changes to the ambients API. See log and Ambient<T> documentation for details (I4c7ee, b/143769776)
  • New repeat mode: Reverse. This mode reverses the previous iteration as the animation repeats in RepeatableSpec or VectorizedRepeatableSpec. (Ibe0f5)
  • API additions to ManualAnimationClock: hasObservers: Boolean and constructor parameter dispatchOnSubscribe: Boolean (Iaa134)
  • Added APIs for getting min/max bounds in AnimatedFloat (Icd9cc)

Bug Fixes

  • runOnIdleCompose renamed to runOnIdle (I83607)
  • Several testing APIs were renamed to be more intuitive. All findXYZ APIs were renamed to onNodeXYZ. All doXYZ APIs were renamed to performXYZ. (I7f164)
  • Introduced low level stateless animation APIs. These APIs (I63bf7)
  • The Recompose composable is no longer a useful abstraction. Most recomposition should happen as a result of MutableState assignments. For anything beyond that, it is recommended that you use the invalidate function to trigger a recomposition of the current scope. (Ifc992)
  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters. Deleted Px class in its entirety (I3ff33)
  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters (Id3434)
  • Crossfade can now work with null as initial value (Iad6a4, b/155947711)
  • Replaced usage of Px class in various compose classes as part of the large refactoring effort to only rely on Dp and primitive types for pixel parameters (I19d02)
  • Consolidated CanvasScope implementations so there is now just DrawScope and ContentDrawScope Renamed CanvasScope to DrawScope. Updated DrawScope to implement Density interface and provide LayoutDirection Deleted DrawScope subclass in ContentDrawScope Painter and PainterModifier have been updated to no longer maintain an RTL property themselves as DrawScope provides this already without manually providing it (I1798e)
  • Updated higher level compose APIs that expose a Canvas to expose CanvasScope instead. This removes the need for consumers to maintain their own Paint objects. For consumers that still require access to a Canvas they can use the drawCanvas extension method which provides a callback to issue drawing commands with the underlying Canvas. (I80afd)
  • Added verticalGravity and horizontalGravity parameters to Row and Column, respectively. (I7dc5a)
  • ui-text module is renamed as ui-text-core (I57dec)
  • Improve DrawModifier API:
    • Made the receiver scope for draw() ContentDrawScope
    • Removed all parameters on draw()
    • DrawScope has same interface as former CanvasScope
    • ContentDrawScope has drawContent() method (Ibaced, b/152919067)
  • runOnIdleCompose and runOnUiThread are now global functions instead of methods on ComposeTestRule. (Icbe8f)
  • [Mutable]State property delegate operators moved to extensions to support Kotlin 1.4 property delegate optimizations. Callers must add imports to continue using by state { ... } or by mutableStateOf(...). (I5312c)
  • ColoredRect has been deprecated. Use Box(Modifier.preferredSize(width, height).drawBackground(color)) instead. (I499fa, b/152753731)
  • Replaced Modifier plus operator with factory extension functions (I225e4)
  • Deprecated Center composable. It should be replaced either with the LayoutSize.Fill + LayoutAlign.Center modifier, or with one of the Box or Stack composables with suitable modifiers applied (Idf5e0)
  • Renamed LayoutFlexible to LayoutWeight. Renamed tight parameter to fill. (If4738)
  • The Opacity composable function has been replaced with the drawOpacity modifier. (I5fb62)
  • Tests using AndroidComposeTestRule now provide an animation clock at the root of the composition that allows it to be paused, resumed and advanced manually. (Id54c5)
  • Support right-to-left direction in LayoutPadding modifier (I9e8da)
  • Density and DensityScope were merged into one interface. Instead of ambientDensity() you can now use DensityAmbient.current. Instead of withDensity(density) just with(density) (I11cb1)
  • Added copy methods to various inline class types including:
    • Offset
    • Size
    • Radius
    • Motion
    • TransformOrigin
    • Deprecated Size.copy companion object method favor of instance copy method (Ife290, b/159905651)
  • androidx.compose.ViewComposer has been moved to androidx.ui.node.UiComposer androidx.compose.Emittable has been removed. It was redundant with ComponentNode. androidx.compose.ViewAdapters has been removed. They are no longer a supported use case. Compose.composeInto has been deprecated. Use setContent or setViewContent instead. Compose.disposeComposition has been deprecated. Use the dispose method on the Composition returned by setContent instead. androidx.compose.Compose.subcomposeInto has moved to androidx.ui.core.subcomposeInto ComponentNode#emitInsertAt has been renamed to ComponentNode#insertAt ComponentNode#emitRemoveAt has been renamed to ComponentNode#removeAt ComponentNode#emitMode has been renamed to ComponentNode#move (Idef00)