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

Compose Foundation

Write Jetpack Compose applications with ready to use building blocks and extend foundation to build your own design system pieces.
Latest Update Current Stable Release Next Release Candidate Beta Release Alpha Release
October 28, 2020 - - - 1.0.0-alpha06


Compose is combination of 7 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.
uiWorks with the Jetpack Compose library.

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 ""

android {
    buildFeatures {
        compose true

    composeOptions {
        kotlinCompilerVersion "1.4.0"
        kotlinCompilerExtensionVersion "1.0.0-alpha06"

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

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-alpha06

October 28, 2020,, and are released. Version 1.0.0-alpha06 contains these commits.

API Changes

  • has been moved to androidx.compose.material.Icon. You can also use the Image component / Modifier.paint() with a Painter if you do not want to use the Material library. (I9f622)
  • Added interactionState to Modifier.scrollable, ScrollableColumn and LazyColumnFor (I81566, b/169509805)
  • alignByBaseline was added to RowScope and alignWithSiblings was renamed to alignBy (I06503, b/170628732)
  • Box was made an inline function. (Ibce0c, b/155056091)
  • Added maxLines to CoreTextField (Ibee58, b/143687793)
  • Added softwrap to CoreTextField. (I21a4b)

Bug Fixes

  • Deprecate VectorPainter in favor of rememberVectorPainter to better indicate that the composable API internally leverages 'remember' to persist data across compositions. (Ifda43)
  • Enable transitions in ComposeTestRule; remove option to enable the blinking cursor from ComposeTestRule. (If0de3)
  • Added single line keyboard option to CoreTextField (I72e6d)
  • Renamed Radius API to CornerRadius to better express how it is used throughout Compose. Updated documentation to indicate that negative corner radii are clamped to zero. (I130c7, b/168762961)
  • Add ability to specify inspector info in composed modifier (Idee08, b/163494569)
  • Added KeyboardCapitalization IME Option (I8ac38)
  • Fix Rtl Handle Position. (I6e1e0)
  • Breaking change: removed the return value from PointerInputFilter.onPointerEvent(...) given that the only value that should be able to be changed in pointer events is consumption data. Instead of returning data from PointerInputFilter.onPointerEvent(...), now you can just mutate the consumption data of the PointerEvents passed in. (I6acd0)
  • Added SelectAll option into selection menu (Ief02b)

Version 1.0.0-alpha05

October 14, 2020,, and are released. Version 1.0.0-alpha05 contains these commits.

API Changes

  • CoreTextField now supports cursor functionality (Id23aa)
  • 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)

Bug Fixes

  • As part of the standardization of sentinel values for inline classes, rename Color.Unset to Color.Unspecified for consistency with other inline classes (I97611, b/169797763)
  • Added Copy/Paste/Cut accessibility actions (I6db4f)
  • TextOverflow.None is introduced. When overflow is None, Text won't handle overflow anymore, and it will report its actual size to LayoutNode. (I175c9, b/158830170)
  • Updated Size.Unspecified parameters to be Float.NaN instead of Float.POSITIVE_INFINITY. Updated Painter implementations to check against Size.Unspecified as well as non-finite Sizes. (I95a7e)
  • Added Paging Compose module and paging integration (Ib85da)
  • Modify LazyListScope to receive nullable values (I1765b)
  • OnPositionedModifier is renamed to OnGloballyPositionedModifier and onPositioned() is renamed to onGloballyPositioned(). (I587e8, b/169083903)
  • Added samples for LazyColumn/Row (Idc16d)
  • Fix for the items and itemsIndexed methods to allow emptyList (I06647)
  • Add a DSL for specifying inspector information (Ic9a22)
  • Move LongPress into Text. (Iff2bc)
  • Disable Selection in Text, and a Demo. (Ie7e97)
  • Support AnnotatedString to SpannableString conversion for accessibility. (Ief907)
  • Removed PointerInputFilter.onPointerInput(...). PointerInputFilter.onPointerEvent(...) should be used in its place. (I6f04a)

Version 1.0.0-alpha04

October 1, 2020,, and are released. Version 1.0.0-alpha04 contains these commits.

API Changes

  • Stack was renamed to Box. The previously existing foundation.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)
  • Add a new LazyListState class. This allows for observation and control of the scroll position of LazyRow and LazyColumn components. Instances can be created using rememberLazyListState() and passed into the state parameter of the component. Currently, the first visible item and offsets can be observed in this initial version. (Ic7cb7, b/159307669)
  • Lazy list position and scroll offset are now saved and restored across Activity recreation (Ie045f, b/166589058)
  • Add long click semantics action (I6281b, b/156468846)
  • MutatorMutex utility added for keeping a single mutator of shared state over time and cancelling conflicting mutators by priority (I3f975)
  • Annotated rootAnimationClockFactory, transitionsEnabled, blinkingCursorEnabled and textInputServiceFactory with @VisibleForTesting, make them internal API and hide their kdoc (I554eb, b/168308412)
  • Removed inlineContent parameter from Text with String input. It won't be used because inlineContent must work with AnnotatedString. (Ief403)
  • The deprecated custom Arrangement APIs were removed. (Ic576d, b/168297922, b/168297923)
  • The unbounded parameter was added to wrapContentSize modifiers, which enables measuring the layout element with infinite max constraints. (I77951, b/158559319)
  • 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)

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)
  • Performance optimizations for LazyColumnFor/LazyRowFor scrolling by not doing unnecessary recompositions during every scroll (I64f65, b/168293643, b/167972292, b/165028371)
  • Fixed crash in LazyColumnFor/LazyRowFor after scrolling and then changing items and implemented auto scrolling up when the previously visible item was removed so we don't display empty gaps in the end anymore (I220ab, b/161480164, b/167855468)
  • Nesting scrollable in the same direction containers like ScrollableContainer and LazyColumnFor is not allowed anymore. It was never supported and was breaking the fling and all the laziness of composing the items of LazyColumnFor (I6e101)
  • Updated many Graphics APIs
    • Updated DrawScope APIs with scoped transformation methods to indicate that the transformation is only applied within the callback and removed after the callback is invoked
    • Updated clipPath documentation to refer to Path instead of rounded rectangle
    • Fixed spacing in documentation for right parameter in clipPath
    • Renamed DrawScope.drawCanvas to drawIntoCanvas and removed size parameter
    • Renamed dx/dy parameters in inset method to horizontal and vertical
    • Added inset overload that provides the same inset value to all 4 bounds
    • Removed documentation on inset method indicating that inset would be applied to all 4 sides
    • Updated documentation for Rect class
    • Updated comments on Rect parameters to match kdoc style
    • Removed Rect.join and Rect.expandToInclude
    • Created overload for Rect.translate(offset) and deprecated Rect.shift
    • (If086a, b/167737376)
  • add AccessibilityScrollState to semantics properties. (Ifeda9)
  • Make TextRange inline to avoid object creation. (Id034b)
  • ParagraphConstraints is removed. Width is directly passed to Paragraph now. (Ica712)

Version 1.0.0-alpha03

September 16, 2020,, and are released. Version 1.0.0-alpha03 contains these commits.

API Changes

  • InnerPadding was renamed to PaddingValues. (I195f1, b/167389171)
  • Usages of gravity were consistently renamed to align or alignment in layout APIs. (I2421a, b/164077038)
  • An alignment parameter was added to Stack, which allows specifying the default alignment for all the Stack children. (Ie80ca, b/164085265)

Bug Fixes

  • DpConstraints and APIs using it were deprecated. (I90cdb, b/167389835)
  • The parameters minWidth and maxWidth of widthIn were renamed to min and max. Similarly for preferredWidthIn, heightIn, preferredHeightIn. (I0e5e1, b/167389544)
  • Added onNode and other global methods on ComposeTestRule as the current global ones are going to be deprecated. (Ieae36)
  • Fixed size and position calculations in GestureScope, which caused amongst others generation of invalid swipe gestures (Iaf358, b/166589947)
  • Moved createAndroidComposeRule and AndroidInputDispatcher from to androidx.ui.test (Idef08, b/164060572)

Version 1.0.0-alpha02

September 2, 2020,, and are released. Version 1.0.0-alpha02 contains these commits.

Bug Fixes

  • TestUiDispatcher is marked experimental (Iae99d, b/161247083)
  • 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)

Version 1.0.0-alpha01

August 26, 2020,, and are released. Version 1.0.0-alpha01 contains these commits.

Version 0.1.0-dev

Version 0.1.0-dev17

August 19, 2020,, and are released. Version 0.1.0-dev17 contains these commits.

API Changes

  • The spacedBy Arrangement was added for Row and Column, to enable positioning layout children with a fixed spacing. The aligned Arrangment was also added, to enable positioning layout children one next to the other and aligned in the Row/Column according to an Alignment. The previous Arrangement.Vertical#arrange and Arrangement.Horizontal#arrange methods were deprecated, and writing custom Arrangements will not be supported in the future. (I6733d, b/161985975)
  • Offset has become an inline class (Iaec70)
  • Removed onFocusChanged callbacks from TextField. Use Modifier.focusObserver instead. (I51089, b/161297615)
  • Modifier.drawBorder has been deprecated. Use Modifier.border instead. Border data class has been replaced by BorderStroke (I4257d, b/158160576)
  • VerticalScroller and HorizontalScroller have been removed. Use ScrollableColumn/Row instead. Modifier.drawBackground has been removed. Use Modifier.background (I73b0d, b/163019183)
  • Remove marked as deprecated fillMax* modifiers from LazyItemScope as they are making it harder to add such modifiers correctly for items which are not direct children of LazyColumnFor (Ifa78d)
  • added LazyColumn/LazyRow implementation as DSL (I93cc6)
  • Constraints is now an inline class (I88736)
  • Added the ability to size a layout to a fraction of the available space, using the fillMaxWidth, fillMaxHeight and fillMaxSize modifiers. (I945bb, b/161562591)

Bug Fixes

  • Added a modifier param to SelectionContainer (I4aada, b/161487952)
  • Added mergePolicy lambda to SemanticsPropertyKey. This can be used to define a custom policy for mergeAllDescendants semantics merging. The default policy is to use the parent value if already present, otherwise the child value. (Iaf6c4, b/161979921)
  • 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)
  • Removed deprecated FilledTextField component. Please use TextField instead to get the Material Design implementation of the Filled text field. (I5e889)
  • Added backgroundColor parameter to LinearProgressIndicator and removed internal padding from CircularProgressIndicator. Added new ProgressIndicatorConstants.DefaultProgressAnimationSpec which can be used as the default AnimationSpec when animating progress between values (If38b5, b/161809914, b/161804677)
  • 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)
  • Renamed RRect to RoundRect to better fit compose naming patterns Created similar function constructors to RRect and deprecated RRect function constructors (I5d325)
  • Removed onChildPositioned and OnChildPositionedModifier. Developers should use onPositioned and OnPositionedModifier on the child layout instead. (I4522e, b/162109766)
  • IntSize is now an inline class (I2bf42)
  • LongPress the Blank Area to Edit. (Ib1e5b)
  • Hide FloatingToolbar After Tapping on the Text. (If4525)
  • Hide FloatingToolbar When Updating the Selection. (I8444c)
  • Deselect When Blur. (I781a2)

Version 0.1.0-dev16

August 5, 2020,, and are released. Version 0.1.0-dev16 contains these commits.

API Changes

  • LazyItemScope was added for itemContent param of Lazy lists. It provides modifiers to fill the parent max size which solves the use case when the item should fill the viewport and the regular Modifier.fillMaxSize() doesn't work as the item is measured with infinity constraints. (Ibd3b2, b/162248854)
  • Move dialog to ui (I47fa6)
  • Added LazyColumnForIndexed/LazyRowForIndexed - versions of LazyColumnFor/LazyRowFor which provides both index and item in the itemCallback. It is useful when in addition to a current item you need to know a current index. (I65ff3)
  • Modifier.deternimateProgress has been renamed to Modifier.progressSemantics (I9c0b4)
  • LazyColumnItems was renamed to LazyColumnFor. LazyRowItems was renamed to LazyRowFor (I84f84)
  • Add some Marks/Annotations for best practice reason. (I66b20)
  • foundation.shape.corner package were flatten to foundation.share (I46491, b/161887429)
  • Added сrossaxis gravity param for LazyRowItems/LazyColumnItems. LazyRowItems/LazyColumnItems now support wrap content behaviour. (Ib39fc)
  • ZoomableState has been renamed to ZoomableController. Custom curve support has been added for smoothScale. enabled and onZoomStarted functionality has been added (If8b8f)
  • Material FilledTextField was renamed to TextField and foundational TextField was renamed to BaseTextField to make simplest desired API easy to discover and use (Ia6242, b/155482676)
  • Previously deprecated AdapterList has been removed. Use LazyColumnItems instead (I12b9b)
  • Modifier.drawBackground has been renamed to Modifier.background (I13677)
  • The old ConstraintLayout DSL was removed. ConstraintSet2 has been renamed to ConstraintSet. (If58d1, b/162450908)
  • Added Modifier.absoluteOffset() and Modifier.absoluteOffsetPx(). Unlike offset modifiers, absolute offset modifiers will not auto-mirror in right-to-left context (I3aa21)
  • Row and Column are now inline function significantly reducing the overhead of using them. (I75c10)

Bug Fixes

  • Address broad API fixes (I077bc)
    1. Remove unused OffsetBase interface
    2. Align Offset and IntOffset classes to have a consistent API surface
    3. Rename IntOffset.Origin to IntOffset.Zero to be consistent with Offset API
    4. Moved nativeCanvas method off of Canvas interface to support consumers to create their own Canvas instances
    5. Created stub EmptyCanvas class to refactor DrawScope to be a non-null parameter instead of lateinit and ensure non-nullability of the field
    6. Renamed ClipOp enums to be Pascal Case
    7. Renamed FilterQuality enums to be Pascal Case
    8. Renamed StrokeJoin enums to be Pascal Case
    9. Renamed PointMode enums to be Pascal Case
    10. Renamed PaintingStyle enums to be Pascal Case
    11. Renamed PathFillType enums to be Pascal Case
    12. Renamed StrokeCap enums to be Pascal Case
    13. Updated DrawCache implementation to no longer use lateinit params
    14. Updated DrawScope to no longer use lazy delegation for fillPaint and strokePaint internal parameters
    15. Updated Image composable to avoid Box usage for less overhead
    16. Updated Outline class to have @Immutable annotations
    17. Updated PathNode to have @Immutable annotations for each path instruction
    18. Updated Vector subcomposition to remove redundant conditional checks for equality as compose already handles them
    19. Deprecated Rect companion constructor methods in favor of function constructors
    20. Updated Brush classes and function constructors with @Immutable and @Stable APIs
    21. Updated VertexMode enum to be PascalCase
    22. Updated DrawScope selectPaint method to conditionally overwrite stroke parameters on the paint if they have changed
    23. Updated Size to add destructuring API, rename UnspecifiedSize to Unspecified and removed unused methods
  • 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 MonotonicFrameClock equivalent of ManualAnimationClock is now ManualFrameClock. (I111c7, b/161247083)

  • Removed SemanticsNodeInteraction.performPartialGesture. Use SemanticsNodeInteraction.performGesture instead. (Id9b62)

  • Renamed SemanticsNodeInteraction.getBoundsInRoot() to SemanticsNodeInteraction.getUnclippedBoundsInRoot() (Icafdf, b/161336532)

  • 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)

  • 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)

  • Added isFocused() and isNotFocused() SemanticsMatcher. (I0b760)

  • RemeasurementModifier was added. It allows users to synchronously remeasure the layout. In general, you never need it as remeasure/relayout is happening automatically, but we use it inside LazyColumnItems during the scroll. (I5f331, b/160791058)

  • isSystemInDarkTheme now always considers the system-wide dark theme setting, and ignores power saving status before Q, following latest guidance. (I0c10c)

  • OnChildPositioned has been deprecated. Use OnPositioned on the child instead. (I87f95, b/162109766)

  • Renamed AndroidComposeTestRule to createAndroidComposeRule. (I70aaf)

  • Add accessibility action to get TextLayoutResult (I9d6e6)

Version 0.1.0-dev15

July 22, 2020,, and are released. Version 0.1.0-dev15 contains these commits.

To use the 0.1.0-dev15 version of Compose, you will need to:

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

  • Similarly to the new param in ScrollableColumn/ScrollableRow LazyColumnItems/LazyRowItems now also have contentPadding param which allows to add a padding for the content after it has been clipped, which is not possible via just a modifier param. It also allows to add a spacing only before first item/after last item. (Ibc24e)
  • onFocusChange callback in text fields renamed to onFocusChanged (Ida4a1)
  • VerticalScroller and HoriziontalScroller have been deprecated. Use ScrollableColumn and ScrollableRow for build-in experience with Column/Row behaviour and parameters, or Modifier.verticalScroll and Modifier.horizontalScroll on your own element. Similarly, ScrollerPosition has been deprecated in favor of ScrollState' (I400ce, b/157225838, b/149460415, b/154105299)
  • Modifier.draggable and Modifier.scrollable APIs were reworked. DragDirection was removed in favor of Orientation. State required for scrollable has beed simplified. ScrollableState has been renamed to ScrollableController (Iab63c, b/149460415)
  • Single-value semantics properties now use a calling style. For example, 'semantics { hidden = true }' is now written as: semantics { hidden() }. (Ic1afd, b/145951226, b/145955412)
  • Corner sizes used by RoundedCornerShape and CutCornerShape can now be larger than 50% (Id2340, b/160400213)
  • Changed the default ContentScale parameter for the Image composable from Inside to Fit. This was done in order to get behavior to scale up the underlying Painter if the layout size is larger than the intrinsic size of the painter while maintaining the aspect ratio. This behavior better matches expectations for providing fixed sizes to the Image while not affecting the default behavior if only the intrinsic size is used to compute the size of the composable. (I40ae3, b/159838006)
  • 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)
  • Clickable was removed. Use Modifier.clickable (I84bdf)
  • Added LazyRowItems - Horizontally scrolling analogue of LazyColumnItems (Ibbcf7)
  • Introduced low level stateless animation APIs. These APIs (I63bf7)
  • and androidx.ui.input.EditorValue is deprecated. TextField, FilledTextField and CoreTextField composables that uses that type is also deprecated. Please use androidx.ui.input.TextFieldValue instead (I4066d, b/155211005)
  • Replaced usage of IntPx with Int. Replaced IntPxPosition with IntOffset. Replaced IntPxSize with IntSize. (Ib7b44)
  • removed; use (I94939, b/154507984)
  • 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)
  • Added Modifier.zoomable for pinch-to-zoom functionality (Id5d63)
  • Toggleable component has been deprecated. Use Modifier.toggleable instead (I35220, b/157642842)
  • MutuallyExclusiveSetItem has been deprecated. Use Modifier.selectable instead. (I02b47, b/157642842)
  • TestTag is now deprecated. Use Modifier.testTag instead. (If5110, b/157173105)
  • Adds fontWeight parameter to Text, which was accidentally not added previously (I56937)
  • 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)
  • VerticalScroller now provides Column out of the box. HorizontalScroller now provides Row out of the box. (Ieca5d, b/157020670)
  • 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 (Iede0b)
  • Modifier.indication has been added to foundation package. Use it to show press/drag/other indication on your custom interactable elements (I8425f, b/155287131)
  • VerticalScroller and HorizontalScroller now support reversed scrolling is isReversed is set on ScrollerPosition (I953bd)
  • Support adding composables into text layout. (I1373c)
  • 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)
  • Removed deprecated DrawBackground API in favor of drawBackground extension APIs on Modifier. Refactored color, brush and paint drawBackground implementations to reduce code paths as well as remove requirement for Modifier to be created as part of composition. (I0343a)
  • 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)
  • HorizontalScroller and VerticalScroller not restores their scroll position using saved instance state. (Ia0fae, b/155075048)
  • FocusManagerAmbient is removed. Use FocusModifier.requestFocus to obtain focus. (Ic4826)
  • Table layout was removed temporarily until we will make it available again with a refreshed API. (Id88a7)
  • Created CanvasScope API that wraps a Canvas object to expose a stateless, declarative drawing API surface. Transformations are contained within their own receiver scope and sizing information is also scoped to corresponding inset bounds. It does not require a consumer to maintain its own Paint state object for configuring drawing operations.

    Added CanvasScopeSample as well as updated the demo app to include a declarative graphics demo (Ifd86d)

  • ColoredRect has been removed. User Box with drawBackground modifier instead (I983c7, b/152753731)

  • Add cursor color customisation to the TextField (I6e33f)

  • Now it is possible to hide/show software keyboard by using SoftwareKeyboardController which is delivered by onTextInputStarted callback (I8dc44, b/151860051)

  • TextFieldValue used with TextField can now be survive activity recreation when used like this: var text by savedInstanceState(saver = TextFieldValue.Saver) { TextFieldValue() } (I5c3ce, b/155075724)

  • Adds commonly used parameters to Text(). If you are currently creating a local text style to pass a small number of these parameters, such as Text(style = TextStyle(textAlign = TextAlign.Center)), you can now just provide the parameters directly: Text(textAlign = TextAlign.Center) (I82768)

  • Replaced CoreTextField/TextField focusIdentifier parameter with FocusNode in order to integrate with focus subsystem. (I7ea48)

  • TextField update - in horizontal dimension it will occupy all available space granted to it (Ib08df, b/154638552)

  • Added InteractionState and Interaction, making it easier to build components that react to UI state changes such as press, and drag (Icfe25, b/152525426)

  • RectangleShape moved from* to* (Ia74d5, b/154507984)

  • Replaced all nullable Color uses in API with non-nullable and use Color.Unset instead of null (Iabaa7)

  • TextField API update - merged onFocus and onBlur callbacks into a single onFocusChange(Boolean) callback with parameter (I66cd3)

  • Renamed ScaleFit to ContentScale Moved ContentScale from ui-graphics to ui-core module to live in the same module as the Alignment API. Renamed FillMaxDimension to Crop Renamed FillMinDimension to Fit Renamed Fit to Inside to better match ImageView.ScaleType equivalents Added documentation indicating that the combination of Crop and Alignment.Center achieves the same result as ImageView.ScaleType.CENTER_CROP and Fit used with Alignment.Center achieves the same result as ImageView.ScaleType.FIT_CENTER Inside used with Alignment.Center achieves the same result as ImageView.ScaleType.CENTER_INSIDE (I45f09, b/152842521)

  • Removes ProvideContentColor, instead just use ContentColorAmbient directly with Providers (Iee942)

  • Adds color parameter to text, allowing overriding the color of the text style without needing to manually merge with the style provided in a theme. (I41a66)

  • 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)
  • ColoredRect has been deprecated. Use Box(Modifier.preferredSize(width, height).drawBackground(color)) instead. (I499fa, b/152753731)

  • Shape theming system is updated according to the Material design specification. Now you can provide small, medium and large shapes to be used by most of the components (Ifb4d1)

  • Replaced Modifier plus operator with factory extension functions (I225e4)

  • Draggable has been moved to modifier (Id9b16, b/151959544)

  • Moved Text to package, from androidx.ui.core. (I87ce5)

  • add enabled param to Checkbox, Switch and Toggleable (I41c16)

  • Ripple is now a Modifier. While Clickable is not yet converted the recommended usage is Clickable(onClick = { ... }, modifier = ripple()) (Ie5200, b/151331852, b/150060763)

  • Added VectorPainter API to replace existing subcomposition API for vector graphics. Result of subcomposition is a VectorPainter object instead of a DrawModifier. Deprecated previous DrawVector composables in favor of VectorPainter.

    Renamed Image(Painter) API to PaintBox(Painter) Created Vector composable that behaves like the Image composable except with a VectorAsset instead of an ImageAsset (I9af9a, b/149030271)

  • Created Image composable to handle sizing/layout in addition to drawing a given ImageAsset to the screen. This composable also supports drawing any arbitrary Painter instance respecting its intrinsic size as well as supporting a given fixed size or minimum size (Ibcc8f)

  • Button, FloatingActionButton and Clickable now have a separate enabled param. Some of the params on Button were renamed or reordered. (I54b5a)

  • Renamed Image to ImageAsset to better differentiate the difference between the Image data and the upcoming Image composable used to participate in layout and draw content.

    Created extension method on, Bitmap.asImageAsset(), to create an instance of an ImageAsset useful for combining traditional Android application development with the compose framework. (Id5bbd)

  • DrawImage composable was removed. Use ImagePainter to draw image on existing layout, or SimpleImage to introduce Image that takes space (I595e1, b/149827027)

  • Stack component supports right-to-left directionality (Ic9e00)

  • Added Icon, IconButton and IconToggleButton, removing AppBarIcon. You can directly replace existing usages of AppBarIcon with IconButton, and they will now have the correct touch target. See the samples for usage information, and see Icons for the provided Material Icons you can use directly with these components. (I96849)

  • DrawShape composable was removed. Use DrawBackground modifier instead. (I7ceb2)

  • Added AdapterList, a scrolling list component that only composes and lays out the visible items. Currently known issues include that it is vertical-only and does not fully handle all cases of changes to its children. (Ib351b)

  • Scrollable component has been added, which allows creation of custom Scrollers/Lists (I5fd37)

  • Renamed background to DrawBackground and make it to be memorized by default (Ia0bd3)

  • Add paddings, border, shape and background param to Box (I05027, b/148147281)

  • Added Canvas component. This composable takes up some size (provided by user) and allows you to draw using CanvasScope (I0d622)

  • rename Border modifier to DrawBorder (I8ffcc)

  • Added Box component for combining layout and drawing common functionality. (I6e2a7)

  • Scrollers now exhibit native Android fling motion behavior. (I922af, b/147493715)

  • Replaced DrawBorder in favor of Border Modifier (Id335a)

  • Modifier.tag was renamed to Modifier.layoutId, to avoid confusion with Modifier.testTag. (I995f0)

  • The percent parameter when creating ConstraintLayout guidelines has been renamed to fraction. (Ida2db)

  • Added support for margins of ConstraintLayout barriers. (I47ffe)

  • Fixed RTL support in ConstraintLayout. Added RTL unaware APIs. (I3b1c7)

  • A new DSL for ConstraintLayout has been added. Please see the samples for more details. (Icaa9a)

  • Added the @ExperimentalLayout annotation. ConstraintLayout, FlowRow and FlowColumn are now tagged with it to mark that their APIs are going to change. (I412a8)

  • Modifier.padding(InnerPadding) has been added (I94985, b/157133803)

  • Removed deprecated RowAlign, ColumnAlign in Row and Column. (If60d4, b/155858731)

  • Removed deprecated LayoutTag(), please use Modifier.tag() instead. Removed deprecated Modifier.matchParent(), please use Modifier.matchParentSize() instead. (If8044)

  • Added the offsetPx layout modifier, which can be used to define (dynamic) offsets in px. (I5af57)

  • AlignmentLineOffset composable is deprecated, please use relativePaddingFrom() modifier instead. CenterAlignmentLine composable is removed. (I60107)

  • Added defaultMinSizeConstraints layout modifier, which sets size constraints to the wrapped layout only when the incoming corresponding constraints are unspecified (0 for min constraints and infinity for max constraints). (I311ea, b/150460257)

  • Container has been removed. Use Box instead (Ibbc2b, b/151407926)

  • Removed deprecated LayoutWidth/Height/Size modifiers. (Ib0bc1)

  • Added default parameter values for the offset modifier. (I37f06)

  • Added symmetric padding modifier. (I39840)

  • Removed deprecated LayoutAspectRatio modifier. (I65a74)

  • Removed deprecated LayoutAlign modifiers. (I10877)

  • Fixed a bug in the width and height modifiers that was causing the wrapped layout to be measured with no opposite axis constraints. (I210b8, b/154797971)

  • Added verticalGravity and horizontalGravity parameters to Row and Column, respectively. (I7dc5a)

  • Updated wrapContentWidth and wrapContentHeight to expect vertical or horizontal Alignment rather than any Alignment. The gravity modifier was updated to accept vertical or horizontal Alignment. Row, Column and Stack were updated to support custom continuous Alignments. (Ib0728)

  • Made Alignment instantiable with arbitrary values. Added 1D Alignments. (Ia0c05)

  • Renamed EdgeInsets to InnerPadding. Renamed innerPadding parameter of Material Buttons to paddding. (I66165)

  • alignToSiblings now accepts a Measured instead of Placeable. (I5788d)

  • Added modifiers for sizing to intrinsic measurements and deprecated the components serving this purpose. (I8295d)

  • Added support for customizing dimensions of children of ConstraintLayout (Idb1a5)

  • Removed deprecated Wrap and Center composables. (I29e23)

  • Added LayoutModifier2, a new API for defining layout modifiers; deprecated LayoutModifier (If32ac)

  • RowScope and ColumnScope members are now accessible outside Row and Column. (I3a641)

  • Container has been deprecated. Use Box instead. (I675ce, b/151407926)

  • Added the LayoutOffset modifier for offsetting layout position (I0b8a3)

  • Initial support for Rtl in Compose layout (Ia5519)

  • Updated LayoutAlign to not fill the available space anymore (I2b14f)

  • Removed AspectRatio composable in favor of modifier. Deleted obsolete FlexColumn, FlexRow composables and Spacing modifier (Iec8a7)

  • Removed the LayoutInflexible modifier for Row and Column (I0d820)

  • Implement Drag Selection Handles to change selection for TextField. (I27032)

  • Implements LongPressAndDrag for TextField Selection. (I17919)

Bug Fixes

  • FocusModifier is deprecated in favor of Modifier.focus, Modifier.focusRequester, Modifier.focusObserver. FocusState and FocusDetailedState are deprecated in favor of FocusState2 (I46919, b/160822875, b/160922136)
  • 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)
  • Removes previously deprecated Modifier.ripple. Clickable now uses ripple as the default indication (if you have a MaterialTheme {} set in your application) so in most cases you can just use clickable and get ripple indication for free. If you need to customize the color / size / bounded parameter for the ripple, you can manually create a RippleIndication and pass it to clickable as the indication parameter. (I663b2, b/155375067)
  • Removed obsolete size testing APIs. (Iba0a0)
  • Made LayoutNode experimental API (I4f2e9)
  • Version 1 of scroll orientation locking is implemented across Compose. (I1ce7a, b/150289741)
  • Popups, Dialogs and Menus are now inheriting the contextual MaterialTheme (Ia3665, b/156527485)
  • Removed layout direction parameter from the measure block of the Layout() function. Layout direction is however available inside the callback through the measure scope object (Ic7d9d)
  • Add AbsoluteArrangement - allows for arrangement of the children inside the Row without automatic mirroring in RTL (I3a1df)
  • @Untracked annotation has been deprecated. Replace with @ComposableContract(tracked=false) (Id211e)
  • Prior to this change, the compose compiler plugin would non-trivially intercept calls to constructors inside of a @Composable function if there was an (I5205a, b/158123804)
  • Add viewModel() composable which allows to create or get already created ViewModel similarly to how it works in Activity or Fragment (I5fdd1)
  • Refactored Radius class to be an inline class. Removed companion creation methods in favor of function constructor with default parameter to have the radius along the y-axis match that of the mandatory x-axis radius parameter.

    Updated DrawScope.drawRoundRect to consume a single Radius parameter instead of 2 separate float values for the radius along the x and y axis (I46d1b)

  • 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 (I086f4)

  • 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)

  • 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 (I97a5a)

  • TextField's cursor has a blinking animation (Id10a7)

  • Partial gestures no longer require passing around of a GestureToken (Id7ae5)

  • 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 (I57bff)

  • Modifier.semantics has been undeprecated to allow usages for high level components. (I4cfdc)

  • Rename AnnotatedString.Builder.addAnnotationString to addStringAnnotation. (I5059e)

  • Updated Alignment API and added support for absolute alignment (which does not auto-mirror in Rtl context) (I38cd3)

  • Layout and LayoutModifier children can be measured with a different layout direction. (Ibd731)

  • Introduce additional optional rect parameter to ImagePainter to support drawing a subsection of underlying ImageAsset (I0ea9e)

  • Fixed a crash in AdapterList when removing items (Ic64b0, b/153195921)

  • We changed how we measure the first layout you put inside activity.setContent { } block. Previously it was forced to fill the whole activity screen, and now it behaves as if you put your layout inside a Stack: it can be smaller than a screen and will be positioned in the top left screen. If you want the old behaviour you can apply Modifier.fillMaxSize() for your layout. (Ie88a7, b/153453714)

  • ui-text-compose module is renamed as ui-text. ui-text now contains CoreText and CoreTextField composables (Ib7d47)

  • ui-text module is renamed as ui-text-core (I57dec)

  • Moved ui-framework/CoreText, CoreTextField composables under ui-text-compose. You might want to include ui-text-compose in your project. (I32042)

  • 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)

  • DrawLayerModifier and drawLayer() now default clipToBounds and clipToOutline to false. (I0eb8b, b/152810850)

  • Renamed LayoutResult to MeasureResult. (Id8c68)

  • 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)

  • DrawVector has been changed from a regular composable function to returning a Modifier drawVector() that will draw the vector as a background to a layout. (I7b8e0)

  • Replace composable function Clip with modifier drawClip(). DrawClipToBounds is a convenient modifier to use when you only need to clip to the layer bounds with a rectangle shape. (If28eb)

  • Replaced DrawShadow composable function with drawShadow() modifier. Shadows are now drawn as part of LayerModifier. (I0317a)

  • 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)

  • Deprecated Wrap composable. It can be replaced either with the LayoutAlign modifier or with the Stack composable (Ib237f)

  • Made the layout direction be propagated from parent layout node to children. Added layout direction modifier. (I3d955)

  • Rename Painter.toModifier to Painter.asModifier as the newly created Modifier has a reference to the original Painter that can be shared across multiple Modifier instances (I7195b)

  • Deprecated: Draw composable is a common source of bugs as it's (I78392, b/149827027)

  • 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)

  • 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)

  • Alignment line Int positions returned from Placeable#get(AlignmentLine) are now non-null. If the queried alignment line is missing, AlignmentLine.Unspecified will be returned. (I896c5, b/158134875)

  • Fixed a ConstraintLayout bug causing a crash on recompositions. (Ibee5a, b/158164341)

  • WithConstraints trailing lambda API has been changed. Now instead of two params it has a receiver scope which in addition to constraints and layoutDirection provides minWidth, maxWidth, minHeight and maxHeight properties in Dp (I91b9a, b/149979702)

  • Renamed LayoutModifier2 to LayoutModifier. (Id29f3)

  • Intrinsic measurements functions in Layout and LayoutModifier2 have an IntrinsicMeasureScope receiver now which provides intrinsics query API with implicitly propagated layout direction. (Id9945)

  • LayoutDirectionAmbient is deprecated. To read the layout direction defined by the locale, use localeLayoutDirection on ConfigurationAmbient (I851b1)

  • Added positionInParent and boundsInParent for LayoutCoordinates. (Icacdd, b/152735784)

  • ParentData composable is deprecated. You should either create a modifier which implements ParentDataModifier interface, or use LayoutTag modifier if you simply need to tag layout children to recognize them inside the measure block. (I51368, b/150953183)

  • Add OnPositionedModifier and OnChildPositionedModifier to replace OnPositioned and OnChildPositioned composable functions. (I2ec8f)

  • Disallow negative padding in LayoutPadding. LayoutOffset should be used instead for negative position offsets. (Ifb5b1)

  • WithConstraints got LayoutDirection parameter (I6d6f7)

  • Updated the ComposeFlags.COMPOSER_PARAM flag to be true, which will change the code generation strategy for the compose plugin. At a high level, this causes @Composable functions to be generated with an additional synthetic parameter, which is passed through to subsequent @Composable calls in order for the runtime to properly manage execution. This is a significant binary breaking change, however, should preserve source-level compatibility in all sanctioned usage of compose. (I7971c)

  • Changed LayoutCoordinates to make providedAlignmentLines a Set instead of a Map and have LayoutCoordinates implement the get() operator instead for retrieving a value. This makes it easier for modifiers to modify one or more value of the set without creating a new collection for each modifier. (I0245a)

  • LayoutCoordinates no longer has a position property. The position property does not make sense when considering LayoutModifiers, rotation, or scaling. Instead, developers should use parentCoordinates and childToLocal() to calculate the transform from one LayoutCoordinate to another.

    LayoutCoordinates uses IntPxSize for the size property instead of PxSize. Layouts use integer pixel sizes for layouts, so all layout sizes should use integers and not floating point values. (I9367b)

  • Improvements to the API surface of Constraints (I0fd15)

  • Added TextDirection.Content (I48f36)

  • Ajdust the Toolbar Menu to show copy, cut, paste properly. (Id3955)

  • Add FloatingToolbar for TextField Selection. (Ie8b07)

  • TextDirectionAlgorithm is renamed as TextDirection (I75ce8)

  • TextDirection is renamed as ResolvedTextDirection (I3ff38)

  • Add HapticFeedback to TextField Selection. (I58050)

  • Add Copy, Cut, and Paste methods to TextField Selection. (Idb70b)

  • TestTag and Semantics have been deleted. Use Modifier.testTag and Modifier.semantics instead (I15ff0, b/158841414)

  • Changed the package name for Locale and LocaleList from androidx.ui.text to androidx.ui.intl (I8132c)

  • API change: AnnotatedString(builder: Builder) is renamed to annotatedString(builder: Builder). (Ia6377)

  • API change: AnnotatedString.Item is renamed to AnnotatedString.Range. (I2d44d)

  • Add Toolbar for text related operations. (I49d53)

  • New LifecycleOwnerAmbient is now available. Now an Activity you are using with Compose UI should extend androidx.activity.ComponentActivity (or AppCompatActivity). setContent on is now deprecated (Idb25a, b/153141084)

  • ui-android-text package name (androidx.text) replaced with androidx.ui.text.platform in order to align with androidx policy. (I42711)